40 #ifndef INCLUDED_DISTI_FILE_PATH_CLASS_H
41 #define INCLUDED_DISTI_FILE_PATH_CLASS_H
100 #if defined( DISTI_HAS_RVAL_REFS )
104 *
this = std::move( other );
112 _path = std::move( other._path );
113 _writeAsAbsolutePath = other._writeAsAbsolutePath;
121 GLS_EXPORT
bool IsValid()
const;
144 GLS_EXPORT std::string
Directory()
const;
148 GLS_EXPORT std::string
FileName()
const;
164 inline bool operator!=(
const FilePathClass& path )
const {
return !( *
this == path ); }
166 friend std::ostream& operator<<( std::ostream& outstr,
const FilePathClass& path )
168 outstr << path.Path();
172 friend std::istream& operator>>( std::istream& instr,
FilePathClass& path )
230 static GLS_EXPORT
const char _emptyTag[];
243 , _attribPtr( attribPtr )
244 , _basePath( basePath )
245 , _useEmptyTag( useEmptyTag )
259 , _attribPtr( &_localStoragePath )
260 , _localStoragePath( initialValue )
261 , _basePath( basePath )
262 , _useEmptyTag( useEmptyTag )
266 static const char* GetEmptyTag() {
return _emptyTag; }
274 *_attribPtr = *( ptr->_attribPtr );
284 virtual GLS_EXPORT std::ostream&
WriteValue( std::ostream& outstr )
290 if( _useEmptyTag && _attribPtr->
FileName().empty() )
304 virtual GLS_EXPORT std::istream&
ReadValue( std::istream& instr )
307 GetToEnd( instr, strPath,
true );
313 if( strPath == _emptyTag )
343 virtual GLS_EXPORT std::ostream&
WriteValue( std::ostream& outstr )
351 virtual GLS_EXPORT std::istream&
ReadValue( std::istream& instr )
363 #endif //_PATH_CLASS_H
std::string FileName() const
FilePathClass & operator=(FilePathClass &&other)
Definition: file_path_class.h:108
virtual std::istream & ReadValue(std::istream &instr)
Definition: file_path_class.h:351
static bool StringIsValidPath(const std::string &strPath)
FilePathClass(const FilePathClass &other)
Definition: file_path_class.h:84
void WritePathString(const FilePathClass &basePath, std::string *strPath)
static bool StringIsAbsolutePath(const std::string &strPath)
FilePathClass & operator=(const FilePathClass &other)
Definition: file_path_class.h:90
virtual DistiAttributeBase & operator=(const DistiAttributeBase &oldClass)
virtual DistiAttributeBase & operator=(const DistiAttributeBase &oldClass)
Definition: file_path_class.h:268
const std::string & Path() const
Definition: file_path_class.h:140
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: file_path_class.h:343
bool ReadPathString(const FilePathClass &basePath, const std::string &strPath)
std::string FileExtension() const
static FilePathClass GetCWD()
Definition: file_path_class.h:183
DistiAttributeCWDRelativePath(CallbackMethodCallerBase *callback, const AttributeName &name, FilePathClass *attribPtr, bool useEmptyTag=false)
Definition: file_path_class.h:332
virtual std::istream & ReadValue(std::istream &instr)
Definition: file_path_class.h:304
virtual void CallCallback()
DistiAttributeCWDRelativePath(CallbackMethodCallerBase *callback, const AttributeName &name, FilePathClass initialValue, bool useEmptyTag=false)
Definition: file_path_class.h:338
static const std::string & InvalidPathChars()
virtual std::ostream & WriteValue(std::ostream &outstr)
Definition: file_path_class.h:284
Generally useful defines, macros, enumerations and function prototypes.
static bool StringIsRelativePath(const std::string &strPath)
DistiAttributeFilePathClass(const FilePathClass &basePath, CallbackMethodCallerBase *callback, const AttributeName &name, FilePathClass initialValue, bool useEmptyTag=false)
Definition: file_path_class.h:257
Definition: disti_metadata.h:186
std::string Directory() const
Definition: file_path_class.h:62
Definition: callback_caller_base.h:55
std::string PathRelativeTo(const FilePathClass &basePath) const
Definition: file_path_class.h:327
bool _writeAsAbsolutePath
Definition: file_path_class.h:71
bool operator==(const FilePathClass &path) const
DistiAttributeFilePathClass(const FilePathClass &basePath, CallbackMethodCallerBase *callback, const AttributeName &name, FilePathClass *attribPtr, bool useEmptyTag=false)
Definition: file_path_class.h:241
bool _useEmptyTag
Definition: file_path_class.h:229
Definition: file_path_class.h:223
Macros and helper code to determine what subset of C++11/14/17 is available.
Definition: disti_metadata.h:85
FilePathClass(FilePathClass &&other)
Definition: file_path_class.h:102
Definition: bmpimage.h:46
void WriteAsAbsolutePath(bool value)
Definition: file_path_class.h:200
std::string _path
Definition: file_path_class.h:67