OpenBarnyard
 
Loading...
Searching...
No Matches
TFileSystem.cpp
Go to the documentation of this file.
1#include "ToshiPCH.h"
2#include "TFile.h"
3
4//-----------------------------------------------------------------------------
5// Enables memory debugging.
6// Note: Should be the last include!
7//-----------------------------------------------------------------------------
9
11
13{
14 m_Name = TString8( other.GetName() );
15 m_Prefix = TString8( other.GetPrefix() );
16}
17
18// $Barnyard: FUNCTION 006be2e0
20 : m_Name( name )
21{
22}
23
24// $Barnyard: FUNCTION 006bdd30
25void TFileSystem::SetPrefix( const TString8& a_rcPrefix )
26{
27 m_Prefix = a_rcPrefix;
28
29 for ( TINT32 i = 0; i < m_Prefix.Length(); i++ )
30 {
31 if ( m_Prefix[ i ] == '/' )
32 {
33 m_Prefix[ i ] = '\\';
34 }
35 }
36}
37
38// $Barnyard: FUNCTION 006bdd80
39TBOOL TFileSystem::ToNative( const TString8& a_rcPath, TNativeFileInfo& a_rOutInfo )
40{
41 a_rOutInfo.InternalPath = MakeInternalPath( a_rcPath );
42 a_rOutInfo.Offset = 0;
43 a_rOutInfo.Length = 0;
44 return TTRUE;
45}
46
48{
49 m_Name = a_rFileSystem.GetName();
50 m_Prefix = a_rFileSystem.GetPrefix();
51 return *this;
52}
53
Core file system interface for the Toshi engine.
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
int32_t TINT32
Definition Typedefs.h:12
char TCHAR
Definition Typedefs.h:20
#define TTRUE
Definition Typedefs.h:25
bool TBOOL
Definition Typedefs.h:6
TString8 InternalPath
Definition TFile.h:54
TUINT32 Length
Definition TFile.h:56
TUINT32 Offset
Definition TFile.h:55
TFileSystem & operator=(TFileSystem &a_rFileSystem)
TFileSystem(const TCHAR *a_szName)
const TString8 & GetPrefix() const
Definition TFile.h:117
virtual TBOOL ToNative(const TString8 &a_rcPath, TNativeFileInfo &a_rOutInfo)
Fetches info about the path and returns internal path.
const TString8 & GetName() const
Definition TFile.h:116
TString8 m_Name
Definition TFile.h:122
virtual void SetPrefix(const TString8 &a_rcPrefix)
Sets the directory prefix to work with.
virtual TString8 MakeInternalPath(const TString8 &a_rcPath)=0
Not documented.
TString8 m_Prefix
Definition TFile.h:123