GNUstep Core Data  0.1
CoreDataHeaders.h
00001 /* Universal implementation #include for the GNUstep
00002         Core Data framework.
00003         Copyright (C) 2005 Free Software Foundation, Inc.
00004 
00005         Written by:  H. Nikolaus Schaller <hns@quantum-step.com>
00006         Date: December 2007
00007 
00008         This file is part of the GNUstep Core Data framework.
00009 
00010         This library is free software; you can redistribute it and/or
00011         modify it under the terms of the GNU Lesser General Public
00012         License as published by the Free Software Foundation; either
00013         version 2.1 of the License, or (at your option) any later version.
00014 
00015         This library is distributed in the hope that it will be useful,
00016         but WITHOUT ANY WARRANTY; without even the implied warranty of
00017         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018         Lesser General Public License for more details.
00019 
00020         You should have received a copy of the GNU Lesser General Public
00021         License along with this library; if not, write to the Free
00022         Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
00023 */
00024 
00025 #ifndef GNUSTEP /* if and only if we are not compiling under GNUstep, should these be defined */
00026 #ifndef ASSIGN
00027 #define ASSIGN(VAR, VAL) [(VAR) autorelease], (VAR)=[(VAL) retain]
00028 #endif
00029 #ifndef DESTROY
00030 #define DESTROY(VAR) [(VAR) release], (VAR)=nil
00031 #endif
00032 #ifndef TEST_RELEASE
00033 #define TEST_RELEASE(VAR) if(VAR) [(VAR) release]
00034 #endif
00035 #ifndef _
00036 #define _(STR) STR
00037 #endif
00038 #endif
00039 
00040 #import <CoreData/CoreData.h>
00041 #import "CoreDataUtilities.h"
00042 
00043 @interface NSAttributeDescription (GSCoreDataPrivate)
00044 
00045 - (void) _setAttributeValueClassName: (NSString *) aClassName;
00046 
00047 @end
00048 
00049 @interface NSPropertyDescription (GSCoreDataPrivate)
00050 
00051 - (void) _setEntity: (NSEntityDescription *) entity;
00052 - (void) _ensureEditableWithReason: (NSString *) aReason;
00053 
00054 @end
00055 
00056 @interface NSEntityDescription (GSCoreDataPrivate)
00057 
00058 - (void) _addReferenceToManagedObjectModel: (NSManagedObjectModel *) aModel;
00059 - (NSDictionary *) _fetchedPropertiesByName;
00060 - (NSDictionary *) _filteredPropertiesOfClass: (Class) aClass;
00061 - (void) _removeReferenceToManagedObjectModel: (NSManagedObjectModel *) aModel;
00062 - (void) _setSuperentity: (NSEntityDescription *) anEntityDescription;  // private
00063 
00064 @end
00065 
00066 @interface NSManagedObject (GSCoreDataPrivate)
00067 
00068 - (id) _initAsFaultWithEntity: (NSEntityDescription *) entity
00069                ownedByContext: (NSManagedObjectContext *) context;
00070 
00071 - (void) _setObjectID: (NSManagedObjectID *) newID;
00072 
00073 - (void) _setDeleted: (BOOL) flag;
00074 - (void) _setFault: (BOOL) flag;
00075 
00076 - (void) _insertedIntoContext: (NSManagedObjectContext *) context;
00077 - (void) _removedFromContext;
00078 - (NSPropertyDescription *) _validatedPropertyForKey: (NSString *) key;
00079 
00083 - (NSArray *) _allPropertiesOfSubclass: (Class) aClass;
00084 
00085 - (BOOL) _validateValue: (id *) value
00086                  forKey: (NSString *) key
00087                   error: (NSError **) error
00088                property: (NSPropertyDescription *) desc;
00089 
00090 - (id) _primitiveValueForKey: (NSString *) key doValidation: (BOOL) flag;
00091 
00092 - (void) _setPrimitiveValue: (id) value
00093                      forKey: (NSString *) key
00094                doValidation: (BOOL) validationFlag;
00095 
00096 - (void) _fireFault;
00097 
00098 @end
00099 
00100 @interface NSManagedObjectID (GSCoreDataPrivate)
00101 
00102 - (BOOL) _isEqualToManagedObjectID: (NSManagedObjectID *) otherID;
00103 
00104         // initializes a temporary ID
00105 - (id) _initWithEntity: (NSEntityDescription *) entity;
00106 
00107         // initializes a permanent ID
00108 - (id) _initWithEntity: (NSEntityDescription *) entity
00109        persistentStore: (GSPersistentStore *) persistentStore
00110                  value: (unsigned long long) value;
00111 
00112         // returns the ID's value
00113 - (unsigned long long) _value;
00114 
00115 @end
00116 
00117 
00118 @interface NSManagedObjectModel (GSCoreDataPrivate)
00119 
00120 #ifndef NO_GNUSTEP
00121 // Convenience method.
00122 - (id) _initWithContentsOfFile: (NSString *) aFilePath;
00123 #endif
00124 
00125 #ifndef NO_GNUSTEP
00126         // returns all configurations bound to their respective names in this model.
00127 - (NSDictionary *) _configurationsByName;
00128 #endif
00129 #ifndef NO_GNUSTEP
00130 
00131 - (void) _removeFetchRequestTemplateForName: (NSString *) aName;
00132 
00133         // returns all fetch requests bound to their respective names in this model.
00134 - (NSDictionary *) _fetchRequestsByName;
00135 #endif
00136 
00137 #ifndef NO_GNUSTEP
00138 
00148 - (BOOL) _isEditable;
00149 
00150 #endif
00151 
00152 - (void) _incrementUseCount;
00153 
00154 - (void) _decrementUseCount;
00155 
00156 @end
00157 
00158 @interface NSPersistentStoreCoordinator (GSCoreDataPrivate)
00159 
00160 #ifndef NO_GNUSTEP
00161 
00170 + (void) _addPersistentStoreType: (NSString *) newStoreType
00171                                   handledByClass: (Class) aClass;
00172 
00176 + (NSArray *) _supportedPersistentStoreTypes;
00177 
00178 #endif // NO_GNUSTEP
00179 
00180 @end
00181 
00182 
00183