libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
moFileManager.h
Go to the documentation of this file.
1
/*******************************************************************************
2
3
moFileManager.h
4
5
****************************************************************************
6
* *
7
* This source is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This code is distributed in the hope that it will be useful, but *
13
* WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15
* General Public License for more details. *
16
* *
17
* A copy of the GNU General Public License is available on the World *
18
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19
* obtain it by writing to the Free Software Foundation, *
20
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
* *
22
****************************************************************************
23
24
Copyright(C) 2006 Fabricio Costa
25
26
Authors:
27
Fabricio Costa
28
29
*******************************************************************************/
30
31
#ifndef __MOFILEMANAGER_H
32
#define __MOFILEMANAGER_H
33
34
#include "
moTypes.h
"
35
#include "
moAbstract.h
"
36
#include "
moText.h
"
37
#include "
moResourceManager.h
"
38
#include "
moBuckets.h
"
39
#include "
moParam.h
"
40
41
46
enum
moFileType
{
47
MO_FILETYPE_LOCAL
,
48
MO_FILETYPE_HTTP
,
49
MO_FILETYPE_FTP
,
50
MO_FILETYPE_HTTPS
,
51
MO_FILETYPE_FTPS
,
52
MO_FILETYPE_UDP
,
53
MO_FILETYPE_UTP
54
};
55
56
typedef
long
moFileDate
;
57
typedef
long
moFileSize
;
58
59
#ifdef MO_WIN32
60
#include "io.h"
61
#define moSlash moText("\\")
62
#define moThm moText("/.thm")
63
#define moSlashChar '\\'
64
#endif
65
66
#ifdef MO_LINUX
67
#define moSlash moText("/")
68
#define moThm moText("/.thm")
69
#define moSlashChar '/'
70
#endif
71
72
#ifdef MO_MACOSX
73
#define moSlash moText("/")
74
#define moThm moText("/.thm")
75
#define moSlashChar '/'
76
#endif
77
78
82
enum
moFileStatus
{
83
MO_FILESTATUS_READY
,
84
MO_FILESTATUS_DOWNLOADING
,
85
MO_FILESTATUS_STREAMING
,
86
MO_FILESTATUS_NOT_READY
87
};
88
93
class
LIBMOLDEO_API
moFile
:
public
moAbstract
{
94
95
public
:
96
moFile
();
97
moFile
(
moText
p_CompletePath );
//could be: http://.... or ftp://... or c:\... or ...
98
virtual
~
moFile
();
99
100
virtual
MOboolean
Init
();
101
virtual
MOboolean
Finish
();
102
103
MOboolean
Exists();
104
105
moFileType
GetType();
106
MOboolean
IsRemote();
107
void
SetType(
moFileType
p_filetype );
108
void
SetCompletePath(
moText
p_completepath );
109
110
moText
GetFileName();
111
moText
GetFullName();
112
moText
GetPath();
113
moText
GetFolderName();
114
moText
GetCompletePath();
115
moText
GetAbsolutePath();
116
moText
GetExtension();
117
moText
GetProtocol();
118
119
moFileDate
GetDate();
120
moFileSize
GetSize();
121
122
moFileStatus
GetStatus();
123
124
MOubyte
* GetData();
125
void
Update();
126
127
private
:
128
129
moFileType
m_FileType;
130
moFileStatus
m_FileStatus;
131
132
moFileDate
m_FileDate;
133
moFileSize
m_FileSize;
134
135
moText
m_CompletePath;
136
moText
m_Drive;
137
138
moText
m_Path;
139
moText
m_FileName;
140
141
moText
m_Extension;
142
moText
m_Protocol;
143
144
MOboolean
m_bExists;
145
MOboolean
m_bRemote;
146
//buckets...for downloading...
147
moBucketsPool
*m_pBucketsPool;
148
//
149
MOubyte
*m_pData;
150
151
moTextArray m_Dirs;
152
153
};
154
155
moDeclareExportedDynamicArray
(
moFile
*, moFileArray );
156
160
class
moDirectory
;
161
162
moDeclareExportedDynamicArray
(
moDirectory
*, moDirectoryArray );
163
164
class
LIBMOLDEO_API
moDirectory
:
public
moAbstract
{
165
166
public
:
167
moDirectory
();
168
moDirectory
(
moText
p_CompletePath,
moFileManager
* p_pFileManager = NULL );
//could be: http://.... or ftp://... or c:\... or ...
169
virtual
~
moDirectory
();
170
171
virtual
MOboolean
Init
();
172
virtual
MOboolean
Init
(
moFileManager
*p_FileManager );
173
virtual
MOboolean
Finish
();
174
175
MOboolean
Open(
moText
p_CompletePath,
moText
p_Search =
"/*.*"
);
176
177
MOboolean
Exists();
178
MOboolean
IsRemote();
179
MOboolean
HasSubdirs();
180
void
SetType(
moFileType
p_filetype );
181
void
SetCompletePath(
moText
p_completepath );
182
183
moFileType
GetType();
184
moFileStatus
GetStatus();
185
moText
GetCompletePath();
186
moText
GetDirName();
187
moText
GetProtocol();
188
189
moFile
* FindFirst( );
190
moFile
* FindNext( );
191
moFile
* FindLast( );
192
moFile
* Find(
MOint
index );
193
moFile
* Find(
moText
filename);
194
195
void
Update();
196
197
moFileArray& GetFiles();
198
moDirectoryArray& GetSubDirs();
199
200
protected
:
201
202
moFileType
m_DirType
;
203
moFileStatus
m_DirStatus
;
204
MOint
m_FileIndex
;
205
206
moText
m_DirName
;
207
moTextArray
m_DirNameArray
;
208
moText
m_CompletePath
;
209
moText
m_Protocol
;
210
211
MOboolean
m_bExists
;
212
MOboolean
m_bRemote
;
213
214
moFileManager
*
m_pFileManager
;
215
216
moFileArray
m_Files
;
217
moDirectoryArray
m_SubDirs
;
218
};
219
220
typedef
moDirectoryArray
moDirectories
;
221
223
227
#undef CopyFile
228
#undef CreateDirectory
229
230
class
LIBMOLDEO_API
moFileManager
:
public
moResource
231
{
232
public
:
233
234
moFileManager
();
235
virtual
~
moFileManager
();
236
237
virtual
MOboolean
Init
();
238
virtual
MOboolean
Finish
();
239
240
241
MOboolean
Load(
moText
p_FileName,
MOboolean
bWaitForDownload =
false
);
242
moFile
* GetFile(
moText
p_FileName );
243
244
MOboolean
Open (
moText
p_Path,
MOboolean
bWaitForDownload =
false
);
245
moDirectory
* GetDirectory(
moText
p_Path );
246
247
static
bool
CreateDirectory(
moDirectory
Dir );
248
static
bool
CopyFile(
moText
FileSrc,
moText
FileDst );
249
static
bool
CopyDirectory(
const
moText
& DirSrc,
const
moText
& DirDst );
250
251
static
moText
GetExePath();
252
static
moText
GetWorkPath();
253
static
bool
FileExists(
moText
filename );
254
static
bool
DirectoryExists(
moText
dirname );
255
256
protected
:
257
258
moFileArray
m_Files
;
259
moDirectoryArray
m_Directories
;
260
261
};
262
263
#endif
264
moFileManager
Manejador de archivos.
Definition:
moFileManager.h:230
MO_FILETYPE_UDP
Definition:
moFileManager.h:52
moDirectory::m_Protocol
moText m_Protocol
Definition:
moFileManager.h:209
MO_FILETYPE_FTP
Definition:
moFileManager.h:49
MO_FILESTATUS_DOWNLOADING
Definition:
moFileManager.h:84
moResource
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
Definition:
moResourceManager.h:152
moAbstract::Finish
virtual MOboolean Finish()
Finaliza el objeto, libera recursos.
Definition:
moAbstract.cpp:147
moFileDate
long moFileDate
Definition:
moFileManager.h:56
moParam.h
MOboolean
#define MOboolean
Definition:
moTypes.h:385
moDirectory::m_bExists
MOboolean m_bExists
Definition:
moFileManager.h:211
moDirectory::m_bRemote
MOboolean m_bRemote
Definition:
moFileManager.h:212
MO_FILETYPE_UTP
Definition:
moFileManager.h:53
moDirectory::m_DirStatus
moFileStatus m_DirStatus
Definition:
moFileManager.h:203
moDeclareExportedDynamicArray
moDeclareExportedDynamicArray(moFile *, moFileArray)
moTypes.h
moAbstract
Clase base abstracta de donde deben derivar los objetos [virtual pura].
Definition:
moAbstract.h:191
moAbstract::Init
virtual MOboolean Init()
Inicializa el objeto.
Definition:
moAbstract.cpp:141
moAbstract.h
moDirectory::m_Files
moFileArray m_Files
Definition:
moFileManager.h:216
LIBMOLDEO_API
#define LIBMOLDEO_API
Definition:
moTypes.h:180
MO_FILESTATUS_STREAMING
Definition:
moFileManager.h:85
moResource::Init
virtual MOboolean Init()
Definition:
moResourceManager.cpp:64
moDirectory::m_FileIndex
MOint m_FileIndex
Definition:
moFileManager.h:204
moText0
clase de para manejar textos
Definition:
moText.h:75
MO_FILETYPE_LOCAL
Definition:
moFileManager.h:47
moFileSize
long moFileSize
Definition:
moFileManager.h:57
moDirectory
Definition:
moFileManager.h:164
moDirectory::m_CompletePath
moText m_CompletePath
Definition:
moFileManager.h:208
moResourceManager.h
MOint
#define MOint
Definition:
moTypes.h:388
moDirectory::m_pFileManager
moFileManager * m_pFileManager
Definition:
moFileManager.h:214
moBucketsPool
Administrador de moBucket 's.
Definition:
moBuckets.h:152
MO_FILETYPE_HTTPS
Definition:
moFileManager.h:50
moFileManager::m_Files
moFileArray m_Files
Definition:
moFileManager.h:258
moFileManager::m_Directories
moDirectoryArray m_Directories
Definition:
moFileManager.h:259
moText.h
MO_FILESTATUS_READY
Definition:
moFileManager.h:83
moDirectory::m_DirNameArray
moTextArray m_DirNameArray
Definition:
moFileManager.h:207
moResource::Finish
virtual MOboolean Finish()
Definition:
moResourceManager.cpp:83
moFile
Definition:
moFileManager.h:93
moDirectories
moDirectoryArray moDirectories
Definition:
moFileManager.h:220
MO_FILETYPE_FTPS
Definition:
moFileManager.h:51
MO_FILETYPE_HTTP
Definition:
moFileManager.h:48
moDirectory::m_DirName
moText m_DirName
Definition:
moFileManager.h:206
MO_FILESTATUS_NOT_READY
Definition:
moFileManager.h:86
moBuckets.h
moFileStatus
moFileStatus
Definition:
moFileManager.h:82
moDirectory::m_DirType
moFileType m_DirType
Definition:
moFileManager.h:202
MOubyte
#define MOubyte
Definition:
moTypes.h:399
moFileType
moFileType
Definition:
moFileManager.h:46
moDirectory::m_SubDirs
moDirectoryArray m_SubDirs
Definition:
moFileManager.h:217
libmoldeo
moFileManager.h
Generated on Wed May 17 2017 14:09:17 for libmoldeo (Moldeo 1.0 Core) by
1.8.8