Changeset 204 for cpp


Ignore:
Timestamp:
04/02/14 16:18:01 (11 years ago)
Author:
Maciej Komosinski
Message:

StringFileSystem? more flexible

Location:
cpp/frams/virtfile
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/virtfile/stringfile.cpp

    r197 r204  
    7878        return new StringFILE2(SString(path+sizeof(PREFIX)-1));
    7979        }
    80 return chain->Vfopen(path,mode);
     80return (chain!=NULL) ? chain->Vfopen(path,mode) : NULL;
    8181}
    8282
    8383int StringFileSystem::Vfexists(const char* path)
    84 { return chain->Vfexists(path); }
     84{ return (chain!=NULL) ? chain->Vfexists(path) : 0; }
    8585
    8686VirtDIR *StringFileSystem::Vopendir(const char* path)
    87 { return chain->Vopendir(path); }
     87{ return (chain!=NULL) ? chain->Vopendir(path) : NULL; }
  • cpp/frams/virtfile/stringfile.h

    r197 r204  
    4444  public:
    4545VirtFileSystem *chain;
    46 StringFileSystem(VirtFileSystem *_chain):chain(_chain) {}
     46StringFileSystem(VirtFileSystem *_chain=NULL):chain(_chain) {}
    4747VirtFILE *Vfopen(const char* path,const char*mode);
    4848int Vfexists(const char* path);
Note: See TracChangeset for help on using the changeset viewer.