#include <TFile.h>
Definition at line 233 of file TFile.h.
◆ TFileManager()
TFileManager::TFileManager |
( |
| ) |
|
Definition at line 24 of file TFileManager.cpp.
25 : m_WorkingDirectory( "/" ), m_ValidatedCount( 0 )
26{
27 InvalidateSystemPath();
28}
◆ ~TFileManager()
TFileManager::~TFileManager |
( |
| ) |
|
◆ Create()
TBOOL TFileManager::Create |
( |
| ) |
|
|
static |
Definition at line 15 of file TFileManager_Win.cpp.
16{
17 CreateCommon();
19
20 CHAR currentDir[ 0x200 ];
21 DWORD dirLength = GetCurrentDirectoryA( sizeof( currentDir ), currentDir );
22 TASSERT( dirLength > 0,
"The directory's length is 0" );
23
24 ( new TNativeFileSystem( "local" ) )->SetPrefix( currentDir );
25 ( new TNativeFileSystem( "abs" ) )->SetPrefix( "" );
26 ( new TNativeFileSystem( "null" ) )->SetPrefix( "" );
27
28 fileManager->SetSystemPath( "local" );
29
31}
static TFORCEINLINE TFileManager * GetSingletonSafe()
◆ CreateFile()
Definition at line 99 of file TFileManager.cpp.
100{
101 TASSERT( a_sName.Length() > 0,
"Name can't be empty" );
102
103 ValidateSystemPath();
104 TINT pos = a_sName.Find(
':', 0 );
105
106 if ( pos >= 0 )
107 {
108 TString8 fsName;
109 TString8 fileName;
110
111 fsName.
Copy( a_sName, pos );
112 fileName.
Copy( a_sName.GetString( pos + 1 ) );
113
115
116 if ( pFileSystem !=
TNULL )
117 {
118 return pFileSystem->
CreateFile( fileName, flags );
119 }
120 }
121
123 {
124 TFile* pFile = pFileSystem->
CreateFile( a_sName, flags );
125
126 if ( pFile !=
TNULL )
127 {
128 return pFile;
129 }
130 }
131
133}
#define T2_FOREACH(vecName, iteratorName)
virtual TFile * CreateFile(const TString8 &a_rcFileName, TFILEMODE a_eFileMode)=0
Creates file.
TFileSystem * FindFileSystem(const TString8 &name)
void Copy(const TString8 &src, TINT size=-1)
◆ Destroy()
void TFileManager::Destroy |
( |
| ) |
|
Definition at line 36 of file TFileManager.cpp.
37{
38 {
40 if ( pFileSystem ) delete pFileSystem;
41 }
42
43 {
45 if ( pFileSystem ) delete pFileSystem;
46 }
47
48 {
50 if ( pFileSystem ) delete pFileSystem;
51 }
52
53 {
55 if ( pFileSystem ) delete pFileSystem;
56 }
57
58 DestroyCommon();
59}
◆ FileSystemRelease()
static void TFileManager::FileSystemRelease |
( |
| ) |
|
|
inlinestatic |
◆ FileSystemWait()
static void TFileManager::FileSystemWait |
( |
| ) |
|
|
inlinestatic |
◆ FindFileSystem() [1/2]
Definition at line 72 of file TFileManager.cpp.
73{
75
76 if ( pFileSystem ==
TNULL )
77 {
79 }
80
81 return pFileSystem;
82}
◆ FindFileSystem() [2/2]
Definition at line 85 of file TFileManager.cpp.
86{
88 {
89 if ( pFileSystem->GetName() == name )
90 {
91 return pFileSystem;
92 }
93 }
94
96}
◆ GetFileInfo()
Definition at line 136 of file TFileManager.cpp.
137{
139
140 ValidateSystemPath();
141 TINT pos = a_strPath.
Find(
':', 0 );
142
143 if ( pos >= 0 )
144 {
145 TString8 fsName;
146 TString8 fileName;
147
148 fsName.
Copy( a_strPath, pos );
150
152
153 if ( pFileSystem !=
TNULL )
154 {
155 return pFileSystem->
ToNative( fileName, a_rNativeInfo );
156 }
157 }
158
159
160 if ( m_ValidatedCount != 1 )
161 {
163
164 if ( pFile !=
TNULL )
165 {
168
169 return pFileSystem->
ToNative( a_strPath, a_rNativeInfo );
170 }
171
173 }
174
175 TFileSystem* pFileSystem = m_Validated.Begin();
176 return pFileSystem->
ToNative( a_strPath, a_rNativeInfo );
177}
virtual void DestroyFile(TFile *a_pFile)=0
Destroys specified file.
virtual TBOOL ToNative(const TString8 &a_rcPath, TNativeFileInfo &a_rOutInfo)
Fetches info about the path and returns internal path.
TFileSystem * GetFileSystem() const
TFile * CreateFile(const TString8 &a_strName, TFILEMODE flags)
TINT Find(TCHAR character, TINT pos=0) const
const TCHAR * GetString(TINT a_iIndex=0) const
◆ MakeAbsolutePath()
TString8 TFileManager::MakeAbsolutePath |
( |
const TString8 & | a_rcRelativePath | ) |
const |
Definition at line 263 of file TFileManager.cpp.
264{
266}
static TString8 ConcatPath(const TString8 &a_rcPath1, const TString8 &a_rcPath2)
◆ MountFileSystem()
void TFileManager::MountFileSystem |
( |
TFileSystem * | a_pFileSystem | ) |
|
Definition at line 62 of file TFileManager.cpp.
63{
66
67 m_Invalidated.InsertTail( a_pFileSystem );
68 InvalidateSystemPath();
69}
const TString8 & GetName() const
◆ SetSystemPath()
void TFileManager::SetSystemPath |
( |
const TString8 & | name | ) |
|
|
inline |
Definition at line 270 of file TFile.h.
271 {
272 m_SysPath = name;
273 InvalidateSystemPath();
274 }
◆ ms_oMutex
TMutex TFileManager::ms_oMutex |
|
inlinestatic |
The documentation for this class was generated from the following files: