![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtPathList.h,v $ $Revision: 1.4 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 #include <vrvUtil/vrvUtil.h> 00015 #include <string> 00016 #include <vector> 00017 00018 namespace makVrv 00019 { 00023 class DT_DLL_VRVUTIL DtPathList 00024 { 00025 public: 00026 00028 DtPathList(); 00029 00031 DtPathList(const std::string& path, char separator = defaultSeparator() ); 00032 00034 DtPathList(const std::vector<std::string>& path, 00035 char separator = defaultSeparator() ); 00036 00038 DtPathList(const DtPathList& orig); 00039 00041 DtPathList& operator=(const DtPathList&); 00042 00044 DtPathList& operator=(const std::vector<std::string>&); 00045 00047 ~DtPathList(); 00048 00049 void setSeparator( char separator ); 00050 char separator() const; 00051 00053 void pop(); 00054 00056 void push(const std::string& p); 00057 00059 std::string path() const; 00060 00061 unsigned int size() const; 00062 00063 const std::string& operator[](int i) const; 00064 00065 bool descendsFrom(const DtPathList& s) const; 00066 00067 void remove(int i); 00068 00069 bool contains(const std::string& s) const; 00070 00071 public: 00072 static char defaultSeparator(); 00073 00074 protected: 00075 std::vector<std::string> pathListFrom( const std::string& path ); 00076 00077 protected: 00078 std::vector<std::string> myPath; 00079 char mySeparator; 00080 }; 00081 }