HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_Path.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_Path_h__
19 #define __HUSD_Path_h__
20 
21 #include "HUSD_API.h"
22 #include <UT/UT_WorkBuffer.h>
23 #include <stddef.h>
24 #include <pxr/pxr.h>
25 
27 class SdfPath;
29 
31 {
32 public:
33  HUSD_Path(const HUSD_Path &path);
34  HUSD_Path(const PXR_NS::SdfPath &path);
35  HUSD_Path(const UT_StringRef &path);
36  HUSD_Path();
37  ~HUSD_Path();
38 
39  const PXR_NS::SdfPath &sdfPath() const;
40 
41  const HUSD_Path &operator=(const HUSD_Path &path);
42  const HUSD_Path &operator=(const PXR_NS::SdfPath &path);
43  bool operator==(const HUSD_Path &path) const;
44  bool operator!=(const HUSD_Path &path) const;
45  bool operator<(const HUSD_Path &path) const;
46 
47  bool isEmpty() const;
48  bool isAbsoluteRootOrPrimPath() const;
49  bool hasPrefix(const HUSD_Path &prefix) const;
50 
51  HUSD_Path parentPath() const;
52  HUSD_Path primPath() const;
53  HUSD_Path appendChild(const UT_StringRef &name) const;
54  HUSD_Path appendProperty(const UT_StringRef &name) const;
55 
56  void pathStr(UT_WorkBuffer &outpath) const;
57  UT_StringHolder pathStr() const;
58  UT_StringHolder nameStr() const;
59 
60  // Return a python object holding an SdfPath python object.
61  void *getPythonPath() const;
62 
63  static const HUSD_Path theRootPrimPath;
64 
65 private:
66  // The size of an SdfPath object is 8. We create a block of data that
67  // we will treat as an SdfPath object within the implementation.
68  char mySdfPathData[8];
69 };
70 
71 #endif
72 
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define HUSD_API
Definition: HUSD_API.h:32
GLuint const GLchar * name
Definition: glcorearb.h:785
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
static const HUSD_Path theRootPrimPath
Definition: HUSD_Path.h:63
bool operator<(const GU_TetrahedronFacet &a, const GU_TetrahedronFacet &b)
Definition: path.h:288
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:165