Quellcode durchsuchen

cmFileSys.h/c Added cmFileSysAppName().

master
kevin vor 11 Jahren
Ursprung
Commit
5fe66b872a
2 geänderte Dateien mit 14 neuen und 0 gelöschten Zeilen
  1. 12
    0
      cmFileSys.c
  2. 2
    0
      cmFileSys.h

+ 12
- 0
cmFileSys.c Datei anzeigen

29
 {
29
 {
30
   cmErr_t    err;
30
   cmErr_t    err;
31
   cmLHeapH_t heapH;
31
   cmLHeapH_t heapH;
32
+  const cmChar_t* appNameStr;
32
 #ifdef OS_OSX
33
 #ifdef OS_OSX
33
   _cmFsOsx_t* p;
34
   _cmFsOsx_t* p;
34
 #endif
35
 #endif
134
   {
135
   {
135
 #endif
136
 #endif
136
 
137
 
138
+  p->appNameStr =  cmLhAllocStr(p->heapH,appNameStr);
139
+
137
   hp->h = p;
140
   hp->h = p;
138
 
141
 
139
 #ifdef OS_LINUX
142
 #ifdef OS_LINUX
174
   return rc;
177
   return rc;
175
 }
178
 }
176
 
179
 
180
+const cmChar_t* cmFileSysAppName( cmFileSysH_t h )
181
+{
182
+  cmFs_t* p = _cmFileSysHandleToPtr(h);
183
+  return p->appNameStr;
184
+}
185
+
177
 const cmChar_t* cmFileSysPrefsDir( cmFileSysH_t h )
186
 const cmChar_t* cmFileSysPrefsDir( cmFileSysH_t h )
178
 {
187
 {
179
   cmFs_t* p = _cmFileSysHandleToPtr(h);
188
   cmFs_t* p = _cmFileSysHandleToPtr(h);
1011
 cmFsRC_t             cmFsFinalize()
1020
 cmFsRC_t             cmFsFinalize()
1012
 { return cmFileSysFinalize(&_cmFsH); }
1021
 { return cmFileSysFinalize(&_cmFsH); }
1013
 
1022
 
1023
+const cmChar_t*      cmFsAppName() 
1024
+{ return cmFileSysAppName(_cmFsH); }
1025
+
1014
 const cmChar_t*      cmFsPrefsDir()
1026
 const cmChar_t*      cmFsPrefsDir()
1015
 { return cmFileSysPrefsDir(_cmFsH); }
1027
 { return cmFileSysPrefsDir(_cmFsH); }
1016
 
1028
 

+ 2
- 0
cmFileSys.h Datei anzeigen

59
   // Returns true if the file system handle is active and initialized.
59
   // Returns true if the file system handle is active and initialized.
60
   bool     cmFileSysIsValid(    cmFileSysH_t h );
60
   bool     cmFileSysIsValid(    cmFileSysH_t h );
61
 
61
 
62
+  const cmChar_t* cmFileSysAppName(  cmFileSysH_t h ); //< Return the application name as passed to cmFileSysInitialize()
62
   const cmChar_t* cmFileSysPrefsDir( cmFileSysH_t h ); //< Return the operating system dependent preference data directory for this application.
63
   const cmChar_t* cmFileSysPrefsDir( cmFileSysH_t h ); //< Return the operating system dependent preference data directory for this application.
63
   const cmChar_t* cmFileSysRsrcDir(  cmFileSysH_t h ); //< Return the operating system dependent application resource directory for this application.
64
   const cmChar_t* cmFileSysRsrcDir(  cmFileSysH_t h ); //< Return the operating system dependent application resource directory for this application.
64
   const cmChar_t* cmFileSysUserDir(  cmFileSysH_t h ); //< Return the operating system dependent user directory for this application.
65
   const cmChar_t* cmFileSysUserDir(  cmFileSysH_t h ); //< Return the operating system dependent user directory for this application.
187
   cmFsRC_t        cmFsInitialize( cmCtx_t* ctx, const cmChar_t* appNameStr );
188
   cmFsRC_t        cmFsInitialize( cmCtx_t* ctx, const cmChar_t* appNameStr );
188
   cmFsRC_t        cmFsFinalize();
189
   cmFsRC_t        cmFsFinalize();
189
 
190
 
191
+  const cmChar_t* cmFsAppName();
190
   const cmChar_t* cmFsPrefsDir();
192
   const cmChar_t* cmFsPrefsDir();
191
   const cmChar_t* cmFsRsrcDir();
193
   const cmChar_t* cmFsRsrcDir();
192
   const cmChar_t* cmFsUserDir();
194
   const cmChar_t* cmFsUserDir();

Laden…
Abbrechen
Speichern