1. Jens Alfke
  2. CDBStore

Commits

Jens Alfke  committed e2eb30a

Added -exists method.

  • Participants
  • Parent commits 4908f17
  • Branches default

Comments (0)

Files changed (2)

File Classes/CDBStore.h

View file
 /** Is the CDBStore open? */
 @property (readonly) BOOL isOpen;
 
+/** Does the backing file exist yet? */
+@property (readonly) BOOL exists;
+
 /** Empties the in-memory cache of already-read values.
     Unsaved changes are kept in the cache, however. */
 - (void) emptyCache;

File Classes/CDBStore.m

View file
     return _isOpen;
 }
 
+- (BOOL) exists
+{
+    if( _isOpen )
+        return _reader.isOpen;
+    else
+        return [[NSFileManager defaultManager] fileExistsAtPath: _path];
+}
+
 
 - (void) emptyCache
 {