ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
pathComponent.h
Go to the documentation of this file.
1#line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.11-windows/ufe/include/pathComponent.h"
2#ifndef _ufePathComponent
3#define _ufePathComponent
4// ===========================================================================
5// Copyright 2018 Autodesk, Inc. All rights reserved.
6//
7// Use of this software is subject to the terms of the Autodesk license
8// agreement provided at the time of installation or download, or which
9// otherwise accompanies this software in either electronic or hard copy form.
10// ===========================================================================
11
12#include "common/ufeExport.h"
13#include <string>
14#include <memory>
15#include <vector>
16
18
34public:
35 class Data;
36
42 static bool exists(const std::string& aString);
43
49 static std::vector<PathComponent> toComponents(const std::vector<std::string>& strings);
50
52 static std::size_t tableSize();
53
56 PathComponent(const std::string& aString);
57
60
63
65 operator bool() const;
66
68
69 PathComponent(const PathComponent&) = default;
72
74 bool operator==(const PathComponent& rhs) const;
76 bool operator!=(const PathComponent& rhs) const;
77
79 const std::string& string() const;
81 std::int64_t id() const;
82
83private:
85
86 std::shared_ptr<Data> fData;
87};
88
89}
90
91// Hashing support.
92namespace std {
93template<> struct hash<Ufe::PathComponent> {
94 std::size_t operator()(const Ufe::PathComponent& c) const { return c.id(); }
95};
96}
97
98#endif /* _ufePathComponent */
Constant string representation with fixed space and O(1) comparison.
Definition: pathComponent.h:33
PathComponent()
Constructor to create a null PathComponent.
static std::size_t tableSize()
static std::vector< PathComponent > toComponents(const std::vector< std::string > &strings)
const std::string & string() const
Access the underlying shared string, and its ID. A null PathComponent has an empty string and an ID o...
bool operator!=(const PathComponent &rhs) const
Not equal operator overload.
PathComponent(const std::string &aString)
bool operator==(const PathComponent &rhs) const
Equal operator overload.
std::int64_t id() const
Access the underlying shared string, and its ID. A null PathComponent has an empty string and an ID o...
static bool exists(const std::string &aString)
PathComponent & operator=(const PathComponent &)
~PathComponent()
Destructor.
PathComponent(const PathComponent &)=default
Member-wise copy is fine.
std::shared_ptr< Data > fData
Definition: pathComponent.h:86
std::string string(const Path &path)
Definition: attribute.h:26
Definition: path.h:201
std::size_t operator()(const Ufe::PathComponent &c) const
Definition: pathComponent.h:94
#define UFE_NS_DEF
Definition: ufe.h:35
Definition of macros for symbol visibility.
#define UFE_SDK_DECL
Definition: ufeExport.h:36