Selaa lähdekoodia

cmFileSys.h/c Added cmFileSysAppName().

master
kevin 12 vuotta sitten
vanhempi
commit
5fe66b872a
2 muutettua tiedostoa jossa 14 lisäystä ja 0 poistoa
  1. 12
    0
      cmFileSys.c
  2. 2
    0
      cmFileSys.h

+ 12
- 0
cmFileSys.c Näytä tiedosto

@@ -29,6 +29,7 @@ typedef struct
29 29
 {
30 30
   cmErr_t    err;
31 31
   cmLHeapH_t heapH;
32
+  const cmChar_t* appNameStr;
32 33
 #ifdef OS_OSX
33 34
   _cmFsOsx_t* p;
34 35
 #endif
@@ -134,6 +135,8 @@ cmFsRC_t cmFileSysInitialize( cmFileSysH_t* hp, cmCtx_t* ctx, const cmChar_t* ap
134 135
   {
135 136
 #endif
136 137
 
138
+  p->appNameStr =  cmLhAllocStr(p->heapH,appNameStr);
139
+
137 140
   hp->h = p;
138 141
 
139 142
 #ifdef OS_LINUX
@@ -174,6 +177,12 @@ cmFsRC_t cmFileSysFinalize(   cmFileSysH_t* hp )
174 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 186
 const cmChar_t* cmFileSysPrefsDir( cmFileSysH_t h )
178 187
 {
179 188
   cmFs_t* p = _cmFileSysHandleToPtr(h);
@@ -1011,6 +1020,9 @@ cmFsRC_t             cmFsInitialize( cmCtx_t* ctx, const cmChar_t* appNameStr )
1011 1020
 cmFsRC_t             cmFsFinalize()
1012 1021
 { return cmFileSysFinalize(&_cmFsH); }
1013 1022
 
1023
+const cmChar_t*      cmFsAppName() 
1024
+{ return cmFileSysAppName(_cmFsH); }
1025
+
1014 1026
 const cmChar_t*      cmFsPrefsDir()
1015 1027
 { return cmFileSysPrefsDir(_cmFsH); }
1016 1028
 

+ 2
- 0
cmFileSys.h Näytä tiedosto

@@ -59,6 +59,7 @@ extern "C" {
59 59
   // Returns true if the file system handle is active and initialized.
60 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 63
   const cmChar_t* cmFileSysPrefsDir( cmFileSysH_t h ); //< Return the operating system dependent preference data directory for this application.
63 64
   const cmChar_t* cmFileSysRsrcDir(  cmFileSysH_t h ); //< Return the operating system dependent application resource directory for this application.
64 65
   const cmChar_t* cmFileSysUserDir(  cmFileSysH_t h ); //< Return the operating system dependent user directory for this application.
@@ -187,6 +188,7 @@ extern "C" {
187 188
   cmFsRC_t        cmFsInitialize( cmCtx_t* ctx, const cmChar_t* appNameStr );
188 189
   cmFsRC_t        cmFsFinalize();
189 190
 
191
+  const cmChar_t* cmFsAppName();
190 192
   const cmChar_t* cmFsPrefsDir();
191 193
   const cmChar_t* cmFsRsrcDir();
192 194
   const cmChar_t* cmFsUserDir();

Loading…
Peruuta
Tallenna