![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: $ $Revision: $ $State: $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 #include <vrvCore/vrvCore.h> 00015 #include <makArchives/DtSerialize.h> 00016 #include <string> 00017 00018 namespace makVrv 00019 { 00024 class DT_DLL_VRVCORE DtPagePath 00025 { 00026 public: 00027 00030 struct DT_DLL_VRVCORE PagePathBuilder 00031 { 00032 public: 00033 friend class DtPagePath; 00034 00036 PagePathBuilder container(const std::string& name) const; 00037 00040 DtPagePath page(const std::string& name) const; 00041 00042 protected: 00043 00045 inline const std::string& path() const { return myPath; } 00046 00049 PagePathBuilder(const std::string& name); 00050 00051 std::string myPath; 00052 }; 00053 00056 DtPagePath(); 00057 00059 DtPagePath(const PagePathBuilder& builder); 00060 00062 DtPagePath(const DtPagePath& copy); 00063 00065 static DtPagePath empty(); 00066 00068 static DtPagePath root(); 00069 00071 static PagePathBuilder collection(const std::string& name); 00072 00074 inline const std::string& path() const { return myPath; } 00075 00078 DtPagePath collectionPart() const; 00079 00082 std::string name() const; 00083 00085 bool isEmpty() const; 00086 00088 bool isCollection() const; 00089 00091 bool isPage() const; 00092 00094 bool isChildOf(const DtPagePath& parent) const; 00095 00097 bool isSiblingOf(const DtPagePath& sibling) const; 00098 00100 bool operator ==(const DtPagePath& other) const; 00101 00103 bool operator <(const DtPagePath& other) const; 00104 00106 bool operator !=(const DtPagePath& other) const; 00107 00108 DT_DECLARE_serialize_FUNCTIONS 00109 00110 protected: 00111 00113 template<class Archive> 00114 void _serialize(Archive & ar, const unsigned int version) 00115 { 00116 ar & DT_SERIALIZE_MEMBER(myPath); 00117 } 00118 00121 DtPagePath(const std::string& path); 00122 00124 std::string myPath; 00125 }; 00126 }