ZenLib

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

FileName.h
Go to the documentation of this file.
1 /* Copyright (c) MediaArea.net SARL. All Rights Reserved.
2 *
3 * Use of this source code is governed by a zlib-style license that can
4 * be found in the License.txt file in the root of the source tree.
5 */
6
7 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 //
9 // File name related functions
10 //
11 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12
13 //---------------------------------------------------------------------------
14 #ifndef ZenLib_FileNameH
15 #define ZenLib_FileNameH
16 //---------------------------------------------------------------------------
17
18 //---------------------------------------------------------------------------
19 #include "ZenLib/Ztring.h"
20 //---------------------------------------------------------------------------
21
22 namespace ZenLib
23 {
24
25 //***************************************************************************
26 /// @brief File name manipulation
27 //***************************************************************************
28
29 class FileName : public ZenLib::Ztring
30 {
31 public :
32 //Constructor/Destructor
33 FileName () : Ztring(){}
34 FileName (const tstring& str) : Ztring(str){}
35 FileName (const tstring& str, size_type pos, size_type n=npos) : Ztring(str, pos, n){}
36 FileName (const Char* s, size_type n) : Ztring(s, n){}
37 FileName (const Char* s) : Ztring(s){}
38 FileName (size_type n, char c) : Ztring(n, c){}
39
40 //Read/Write
41 ZenLib::Ztring Path_Get () const;
42 ZenLib::Ztring Name_Get () const;
43 ZenLib::Ztring Extension_Get () const;
44 ZenLib::Ztring& Path_Set (const Ztring &Path);
45 ZenLib::Ztring& Name_Set (const Ztring &Name);
46 ZenLib::Ztring& Extension_Set (const Ztring &Extension);
47
48 //Helpers
49 static ZenLib::Ztring Path_Get (const Ztring &File_Name) {return ((FileName&)File_Name).Path_Get();}
50 static ZenLib::Ztring Name_Get (const Ztring &File_Name) {return ((FileName&)File_Name).Name_Get();}
51 static ZenLib::Ztring Extension_Get (const Ztring &File_Name) {return ((FileName&)File_Name).Extension_Get();}
52 static ZenLib::Ztring TempFileName_Create (const Ztring &Prefix);
53 };
54
55 //Platform differences
56 extern const Char* FileName_PathSeparator;
57
58 } //NameSpace
59
60 //---------------------------------------------------------------------------
61 #ifdef __BORLANDC__
62 #pragma warn .8027
63 #endif
64 //---------------------------------------------------------------------------
65
66 #endif
ZenLib::FileName::FileName
FileName(const tstring &str)
Definition: FileName.h:34
ZenLib::Char
char Char
Definition: Conf.h:215
ZenLib::FileName::FileName
FileName(const Char *s)
Definition: FileName.h:37
ZenLib::FileName::FileName
FileName(const Char *s, size_type n)
Definition: FileName.h:36
ZenLib::FileName::Extension_Get
ZenLib::Ztring Extension_Get() const
ZenLib::FileName::FileName
FileName()
Definition: FileName.h:33
ZenLib::FileName::Path_Set
ZenLib::Ztring & Path_Set(const Ztring &Path)
ZenLib::FileName::FileName
FileName(size_type n, char c)
Definition: FileName.h:38
ZenLib
Definition: BitStream.h:23
ZenLib::FileName::Name_Get
static ZenLib::Ztring Name_Get(const Ztring &File_Name)
Definition: FileName.h:50
ZenLib::FileName::Extension_Set
ZenLib::Ztring & Extension_Set(const Ztring &Extension)
ZenLib::tstring
std::basic_string< Char, std::char_traits< Char >, std::allocator< Char > > tstring
Definition: Ztring.h:28
ZenLib::FileName::Path_Get
static ZenLib::Ztring Path_Get(const Ztring &File_Name)
Definition: FileName.h:49
ZenLib::Ztring
String manipulation (based on std::(w)string)
Definition: Ztring.h:49
ZenLib::FileName_PathSeparator
const Char * FileName_PathSeparator
ZenLib::FileName
File name manipulation.
Definition: FileName.h:29
ZenLib::FileName::Name_Get
ZenLib::Ztring Name_Get() const
ZenLib::FileName::Name_Set
ZenLib::Ztring & Name_Set(const Ztring &Name)
ZenLib::FileName::Extension_Get
static ZenLib::Ztring Extension_Get(const Ztring &File_Name)
Definition: FileName.h:51
ZenLib::FileName::Path_Get
ZenLib::Ztring Path_Get() const
ZenLib::FileName::FileName
FileName(const tstring &str, size_type pos, size_type n=npos)
Definition: FileName.h:35
Ztring.h
ZenLib::FileName::TempFileName_Create
static ZenLib::Ztring TempFileName_Create(const Ztring &Prefix)