[sword-svn] r2531 - in trunk/bindings/objc: ObjCSword.xcodeproj src test
mdbergmann at crosswire.org
mdbergmann at crosswire.org
Sun Aug 1 04:50:47 MST 2010
Author: mdbergmann
Date: 2010-08-01 04:50:46 -0700 (Sun, 01 Aug 2010)
New Revision: 2531
Modified:
trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj
trunk/bindings/objc/src/SwordBible.h
trunk/bindings/objc/src/SwordBible.mm
trunk/bindings/objc/src/SwordBook.h
trunk/bindings/objc/src/SwordBook.mm
trunk/bindings/objc/src/SwordDictionary.h
trunk/bindings/objc/src/SwordManager.h
trunk/bindings/objc/src/SwordManager.mm
trunk/bindings/objc/src/SwordModule.h
trunk/bindings/objc/src/SwordModule.mm
trunk/bindings/objc/test/SwordModuleTest.m
trunk/bindings/objc/test/Test1.h
trunk/bindings/objc/test/TestLocalTest.h
Log:
Some cleanups and better API documentation.
Also renamed one or two methods. Take care when building you application next time.
Modified: trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj
===================================================================
--- trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/ObjCSword.xcodeproj/project.pbxproj 2010-08-01 11:50:46 UTC (rev 2531)
@@ -98,10 +98,8 @@
A94EAC30117B28920018B06F /* SwordVerseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A94EAC08117B28920018B06F /* SwordVerseManager.mm */; };
A94EAC31117B28920018B06F /* VerseEnumerator.h in Headers */ = {isa = PBXBuildFile; fileRef = A94EAC09117B28920018B06F /* VerseEnumerator.h */; settings = {ATTRIBUTES = (Public, ); }; };
A94EAC32117B28920018B06F /* VerseEnumerator.mm in Sources */ = {isa = PBXBuildFile; fileRef = A94EAC0A117B28920018B06F /* VerseEnumerator.mm */; };
- A956316511FD8C55007DC7AD /* libsword-ub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A956316411FD8C55007DC7AD /* libsword-ub.a */; };
A956316611FD8C5B007DC7AD /* libsword-ub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A956316411FD8C55007DC7AD /* libsword-ub.a */; };
A956316711FD8C5E007DC7AD /* libsword-ub.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = A956316411FD8C55007DC7AD /* libsword-ub.a */; };
- A956324311FD90C9007DC7AD /* libclucene-ub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A956324211FD90C9007DC7AD /* libclucene-ub.a */; };
A956324411FD90CE007DC7AD /* libclucene-ub.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A956324211FD90C9007DC7AD /* libclucene-ub.a */; };
A956324511FD90D2007DC7AD /* libclucene-ub.a in CopyFiles */ = {isa = PBXBuildFile; fileRef = A956324211FD90C9007DC7AD /* libclucene-ub.a */; };
A964657C11C662CF00640FAC /* ObjCSword.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* ObjCSword.framework */; };
@@ -113,9 +111,9 @@
A9921A1A11FD9CA8002DAA72 /* libSword.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A9921A1911FD9CA8002DAA72 /* libSword.dylib */; };
A9A2C17D118D9D3D0002873D /* Notifications.h in Headers */ = {isa = PBXBuildFile; fileRef = A9A2C17C118D9D3D0002873D /* Notifications.h */; settings = {ATTRIBUTES = (Public, ); }; };
A9C2819B11C43C6500803CB5 /* TestLocalTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C2818A11C43B9E00803CB5 /* TestLocalTest.m */; };
- A9C2819C11C43C6900803CB5 /* Test.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C2818711C43AB200803CB5 /* Test.m */; };
+ A9C2819C11C43C6900803CB5 /* SetClassTest.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C2818711C43AB200803CB5 /* SetClassTest.m */; };
A9C2819D11C43C6A00803CB5 /* Test1.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C2818411C43A4300803CB5 /* Test1.m */; };
- A9C281A611C43CF000803CB5 /* Test.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C2818111C43A2900803CB5 /* Test.h */; };
+ A9C281A611C43CF000803CB5 /* SetClassTest.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C2818111C43A2900803CB5 /* SetClassTest.h */; };
A9C281A711C43CF000803CB5 /* Test1.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C2818311C43A4300803CB5 /* Test1.h */; };
A9C281A811C43CF000803CB5 /* TestLocalTest.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C2818911C43B9E00803CB5 /* TestLocalTest.h */; };
A9C2856F11C446B700803CB5 /* Configuration.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C2856D11C446B700803CB5 /* Configuration.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -125,6 +123,11 @@
A9D4360511C4FE97007AFE83 /* SwordModule+Index.h in Headers */ = {isa = PBXBuildFile; fileRef = A9D4360311C4FE97007AFE83 /* SwordModule+Index.h */; settings = {ATTRIBUTES = (Public, ); }; };
A9D4360611C4FE97007AFE83 /* SwordModule+Index.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9D4360411C4FE97007AFE83 /* SwordModule+Index.mm */; };
A9D4382311C52947007AFE83 /* locales.d in Resources */ = {isa = PBXBuildFile; fileRef = A9D437CE11C52947007AFE83 /* locales.d */; };
+ A9EF13B31205952C0078A27C /* libSword.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = A9EF13B21205952C0078A27C /* libSword.dylib */; };
+ A9EF1416120595650078A27C /* SwordLocaleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A9EF1414120595650078A27C /* SwordLocaleManager.h */; };
+ A9EF1417120595650078A27C /* SwordLocaleManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9EF1415120595650078A27C /* SwordLocaleManager.mm */; };
+ A9EF1418120595650078A27C /* SwordLocaleManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A9EF1414120595650078A27C /* SwordLocaleManager.h */; };
+ A9EF1419120595650078A27C /* SwordLocaleManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9EF1415120595650078A27C /* SwordLocaleManager.mm */; };
A9FB273711FD95CD004C4295 /* AnalysisHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9FB264511FD95CD004C4295 /* AnalysisHeader.cpp */; };
A9FB273911FD95CD004C4295 /* Analyzers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9FB264711FD95CD004C4295 /* Analyzers.cpp */; };
A9FB273B11FD95CD004C4295 /* StandardAnalyzer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9FB264A11FD95CD004C4295 /* StandardAnalyzer.cpp */; };
@@ -503,10 +506,10 @@
A975EED911C792B9007C1532 /* mod2osis */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = mod2osis; sourceTree = BUILT_PRODUCTS_DIR; };
A9921A1911FD9CA8002DAA72 /* libSword.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSword.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
A9A2C17C118D9D3D0002873D /* Notifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Notifications.h; path = src/Notifications.h; sourceTree = "<group>"; };
- A9C2818111C43A2900803CB5 /* Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Test.h; path = test/Test.h; sourceTree = "<group>"; };
+ A9C2818111C43A2900803CB5 /* SetClassTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SetClassTest.h; path = test/SetClassTest.h; sourceTree = "<group>"; };
A9C2818311C43A4300803CB5 /* Test1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Test1.h; path = test/Test1.h; sourceTree = "<group>"; };
A9C2818411C43A4300803CB5 /* Test1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Test1.m; path = test/Test1.m; sourceTree = "<group>"; };
- A9C2818711C43AB200803CB5 /* Test.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Test.m; path = test/Test.m; sourceTree = "<group>"; };
+ A9C2818711C43AB200803CB5 /* SetClassTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SetClassTest.m; path = test/SetClassTest.m; sourceTree = "<group>"; };
A9C2818911C43B9E00803CB5 /* TestLocalTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestLocalTest.h; path = test/TestLocalTest.h; sourceTree = "<group>"; };
A9C2818A11C43B9E00803CB5 /* TestLocalTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TestLocalTest.m; path = test/TestLocalTest.m; sourceTree = "<group>"; };
A9C2818D11C43BD400803CB5 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
@@ -685,7 +688,9 @@
A9D43A4811C52E9B007AFE83 /* zstr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zstr.h; sourceTree = "<group>"; };
A9D43A4911C52E9B007AFE83 /* ztext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ztext.h; sourceTree = "<group>"; };
A9D43A4A11C52E9B007AFE83 /* zverse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zverse.h; sourceTree = "<group>"; };
- A9FB25E011FD939E004C4295 /* libSword.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; name = libSword.dylib; path = "/Volumes/User/mbergmann/_inProgress/Sources/crosswire/sword-trunk/bindings/objc/build/Release/libSword.dylib"; sourceTree = "<absolute>"; };
+ A9EF13B21205952C0078A27C /* libSword.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libSword.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+ A9EF1414120595650078A27C /* SwordLocaleManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SwordLocaleManager.h; path = src/SwordLocaleManager.h; sourceTree = "<group>"; };
+ A9EF1415120595650078A27C /* SwordLocaleManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = SwordLocaleManager.mm; path = src/SwordLocaleManager.mm; sourceTree = "<group>"; };
A9FB264511FD95CD004C4295 /* AnalysisHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnalysisHeader.cpp; sourceTree = "<group>"; };
A9FB264611FD95CD004C4295 /* AnalysisHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnalysisHeader.h; sourceTree = "<group>"; };
A9FB264711FD95CD004C4295 /* Analyzers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Analyzers.cpp; sourceTree = "<group>"; };
@@ -1114,6 +1119,7 @@
files = (
A9013D3811E316C700E1CCCA /* Cocoa.framework in Frameworks */,
A9921A1A11FD9CA8002DAA72 /* libSword.dylib in Frameworks */,
+ A9EF13B31205952C0078A27C /* libSword.dylib in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1130,8 +1136,6 @@
files = (
A964658F11C6654300640FAC /* SenTestingKit.framework in Frameworks */,
A964657C11C662CF00640FAC /* ObjCSword.framework in Frameworks */,
- A956316511FD8C55007DC7AD /* libsword-ub.a in Frameworks */,
- A956324311FD90C9007DC7AD /* libclucene-ub.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1153,6 +1157,7 @@
A975EED911C792B9007C1532 /* mod2osis */,
A9013D3E11E316C700E1CCCA /* ObjCSword_iOS.framework */,
A9921A1911FD9CA8002DAA72 /* libSword.dylib */,
+ A9EF13B21205952C0078A27C /* libSword.dylib */,
);
name = Products;
sourceTree = "<group>";
@@ -1197,44 +1202,46 @@
08FB77AEFE84172EC02AAC07 /* SwordWrapper */ = {
isa = PBXGroup;
children = (
+ A9EF1414120595650078A27C /* SwordLocaleManager.h */,
+ A9EF1415120595650078A27C /* SwordLocaleManager.mm */,
+ A94EABF9117B28920018B06F /* SwordManager.h */,
+ A94EABFA117B28920018B06F /* SwordManager.mm */,
+ A94EAC07117B28920018B06F /* SwordVerseManager.h */,
+ A94EAC08117B28920018B06F /* SwordVerseManager.mm */,
+ A94EABFD117B28920018B06F /* SwordModule.h */,
+ A94EABFE117B28920018B06F /* SwordModule.mm */,
A94EABE3117B28910018B06F /* SwordBible.h */,
A94EABE4117B28910018B06F /* SwordBible.mm */,
+ A94EABEB117B28920018B06F /* SwordBook.h */,
+ A94EABEC117B28920018B06F /* SwordBook.mm */,
+ A94EABED117B28920018B06F /* SwordCommentary.h */,
+ A94EABEE117B28920018B06F /* SwordCommentary.mm */,
+ A94EABEF117B28920018B06F /* SwordDictionary.h */,
+ A94EABF0117B28920018B06F /* SwordDictionary.mm */,
A94EABE5117B28920018B06F /* SwordBibleBook.h */,
A94EABE6117B28920018B06F /* SwordBibleBook.mm */,
A94EABE7117B28920018B06F /* SwordBibleChapter.h */,
A94EABE8117B28920018B06F /* SwordBibleChapter.m */,
+ A94EABFF117B28920018B06F /* SwordModuleTextEntry.h */,
+ A94EAC00117B28920018B06F /* SwordModuleTextEntry.m */,
+ A94EAC01117B28920018B06F /* SwordModuleTreeEntry.h */,
+ A94EAC02117B28920018B06F /* SwordModuleTreeEntry.m */,
A94EABE9117B28920018B06F /* SwordBibleTextEntry.h */,
A94EABEA117B28920018B06F /* SwordBibleTextEntry.m */,
- A94EABEB117B28920018B06F /* SwordBook.h */,
- A94EABEC117B28920018B06F /* SwordBook.mm */,
- A94EABED117B28920018B06F /* SwordCommentary.h */,
- A94EABEE117B28920018B06F /* SwordCommentary.mm */,
- A94EABEF117B28920018B06F /* SwordDictionary.h */,
- A94EABF0117B28920018B06F /* SwordDictionary.mm */,
- A94EABF1117B28920018B06F /* SwordInstallSource.h */,
- A94EABF2117B28920018B06F /* SwordInstallSource.mm */,
- A94EABF3117B28920018B06F /* SwordInstallSourceController.h */,
- A94EABF4117B28920018B06F /* SwordInstallSourceController.mm */,
+ A94EABFB117B28920018B06F /* SwordModCategory.h */,
+ A94EABFC117B28920018B06F /* SwordModCategory.m */,
A94EABF5117B28920018B06F /* SwordKey.h */,
A94EABF6117B28920018B06F /* SwordKey.mm */,
A94EABF7117B28920018B06F /* SwordListKey.h */,
A94EABF8117B28920018B06F /* SwordListKey.mm */,
- A94EABF9117B28920018B06F /* SwordManager.h */,
- A94EABFA117B28920018B06F /* SwordManager.mm */,
- A94EABFB117B28920018B06F /* SwordModCategory.h */,
- A94EABFC117B28920018B06F /* SwordModCategory.m */,
- A94EABFD117B28920018B06F /* SwordModule.h */,
- A94EABFE117B28920018B06F /* SwordModule.mm */,
- A94EABFF117B28920018B06F /* SwordModuleTextEntry.h */,
- A94EAC00117B28920018B06F /* SwordModuleTextEntry.m */,
- A94EAC01117B28920018B06F /* SwordModuleTreeEntry.h */,
- A94EAC02117B28920018B06F /* SwordModuleTreeEntry.m */,
A94EAC05117B28920018B06F /* SwordVerseKey.h */,
A94EAC06117B28920018B06F /* SwordVerseKey.mm */,
- A94EAC07117B28920018B06F /* SwordVerseManager.h */,
- A94EAC08117B28920018B06F /* SwordVerseManager.mm */,
A94EAC09117B28920018B06F /* VerseEnumerator.h */,
A94EAC0A117B28920018B06F /* VerseEnumerator.mm */,
+ A94EABF1117B28920018B06F /* SwordInstallSource.h */,
+ A94EABF2117B28920018B06F /* SwordInstallSource.mm */,
+ A94EABF3117B28920018B06F /* SwordInstallSourceController.h */,
+ A94EABF4117B28920018B06F /* SwordInstallSourceController.mm */,
A9D4360311C4FE97007AFE83 /* SwordModule+Index.h */,
A9D4360411C4FE97007AFE83 /* SwordModule+Index.mm */,
);
@@ -1328,8 +1335,8 @@
A9C2857911C4486400803CB5 /* Tests */ = {
isa = PBXGroup;
children = (
- A9C2818111C43A2900803CB5 /* Test.h */,
- A9C2818711C43AB200803CB5 /* Test.m */,
+ A9C2818111C43A2900803CB5 /* SetClassTest.h */,
+ A9C2818711C43AB200803CB5 /* SetClassTest.m */,
A9C2818311C43A4300803CB5 /* Test1.h */,
A9C2818411C43A4300803CB5 /* Test1.m */,
A9C2818911C43B9E00803CB5 /* TestLocalTest.h */,
@@ -2307,6 +2314,7 @@
A9C2856F11C446B700803CB5 /* Configuration.h in Headers */,
A9C2857311C4471400803CB5 /* OSXConfiguration.h in Headers */,
A9D4360511C4FE97007AFE83 /* SwordModule+Index.h in Headers */,
+ A9EF1416120595650078A27C /* SwordLocaleManager.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2338,6 +2346,7 @@
A9013D1211E316C700E1CCCA /* Configuration.h in Headers */,
A9013D1311E316C700E1CCCA /* OSXConfiguration.h in Headers */,
A9013D1411E316C700E1CCCA /* SwordModule+Index.h in Headers */,
+ A9EF1418120595650078A27C /* SwordLocaleManager.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2345,7 +2354,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- A9C281A611C43CF000803CB5 /* Test.h in Headers */,
+ A9C281A611C43CF000803CB5 /* SetClassTest.h in Headers */,
A9C281A711C43CF000803CB5 /* Test1.h in Headers */,
A9C281A811C43CF000803CB5 /* TestLocalTest.h in Headers */,
A96465AD11C6658200640FAC /* SwordManagerTest.h in Headers */,
@@ -2454,7 +2463,7 @@
);
name = Sword_iOS;
productName = Sword;
- productReference = A9FB25E011FD939E004C4295 /* libSword.dylib */;
+ productReference = A9EF13B21205952C0078A27C /* libSword.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */
@@ -2550,6 +2559,7 @@
A9C2857411C4471400803CB5 /* OSXConfiguration.m in Sources */,
A9C2858311C44A0A00803CB5 /* Configuration.m in Sources */,
A9D4360611C4FE97007AFE83 /* SwordModule+Index.mm in Sources */,
+ A9EF1417120595650078A27C /* SwordLocaleManager.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2579,6 +2589,7 @@
A9013D3311E316C700E1CCCA /* OSXConfiguration.m in Sources */,
A9013D3411E316C700E1CCCA /* Configuration.m in Sources */,
A9013D3511E316C700E1CCCA /* SwordModule+Index.mm in Sources */,
+ A9EF1419120595650078A27C /* SwordLocaleManager.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2595,7 +2606,7 @@
buildActionMask = 2147483647;
files = (
A9C2819B11C43C6500803CB5 /* TestLocalTest.m in Sources */,
- A9C2819C11C43C6900803CB5 /* Test.m in Sources */,
+ A9C2819C11C43C6900803CB5 /* SetClassTest.m in Sources */,
A9C2819D11C43C6A00803CB5 /* Test1.m in Sources */,
A96465A511C6657900640FAC /* SwordManagerTest.m in Sources */,
A918B8E511C6697400024D84 /* SwordModuleTest.m in Sources */,
@@ -2902,7 +2913,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -2931,7 +2942,7 @@
"\"$(SRCROOT)/build_clucene/build/result_inst/lib\"",
);
MACOSX_DEPLOYMENT_TARGET = 10.5;
- ONLY_ACTIVE_ARCH = NO;
+ ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-DDEBUG";
OTHER_LDFLAGS = (
"-lcurl",
@@ -3133,7 +3144,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
GCC_DYNAMIC_NO_PIC = NO;
@@ -3146,12 +3157,8 @@
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h";
INFOPLIST_FILE = "Tests-Info.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/sword_build/build/result_inst/lib\"",
- "\"$(SRCROOT)/clucene_build/build/result_inst/lib\"",
- );
- ONLY_ACTIVE_ARCH = NO;
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
+ ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-framework",
Cocoa,
@@ -3180,11 +3187,7 @@
GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Headers/Cocoa.h";
INFOPLIST_FILE = "Tests-Info.plist";
INSTALL_PATH = "$(USER_LIBRARY_DIR)/Bundles";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/sword_build/build/result_inst/lib\"",
- "\"$(SRCROOT)/clucene_build/build/result_inst/lib\"",
- );
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = (
"-framework",
Cocoa,
Modified: trunk/bindings/objc/src/SwordBible.h
===================================================================
--- trunk/bindings/objc/src/SwordBible.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordBible.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -39,11 +39,6 @@
+ (int)bookIndexForSWKey:(sword::VerseKey *)key;
#endif
-// ----------- instance methods ------------
-- (id)initWithName:(NSString *)name swordManager:(SwordManager *)aManager;
-#ifdef __cplusplus
-- (id)initWithSWModule:(sword::SWModule *)aModule swordManager:(SwordManager *)aManager;
-#endif
- (BOOL)hasReference:(NSString *)ref;
- (int)numberOfVerseKeysForReference:(NSString *)aReference;
@@ -61,8 +56,8 @@
- (int)versesForChapter:(int)chapter bookName:(NSString *)bookName;
- (int)versesForBible;
+// Text pulling
- (SwordBibleTextEntry *)textEntryForKey:(SwordKey *)aKey textType:(TextPullType)aType;
-
- (NSArray *)strippedTextEntriesForRef:(NSString *)reference context:(int)context;
- (NSArray *)renderedTextEntriesForRef:(NSString *)reference context:(int)context;
Modified: trunk/bindings/objc/src/SwordBible.mm
===================================================================
--- trunk/bindings/objc/src/SwordBible.mm 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordBible.mm 2010-08-01 11:50:46 UTC (rev 2531)
@@ -100,7 +100,7 @@
return key->Book() + key->Testament() * 100;
}
-#pragma mark - instance methods
+#pragma mark - Initializers
- (id)initWithName:(NSString *)aName swordManager:(SwordManager *)aManager {
self = [super initWithName:aName swordManager:aManager];
@@ -124,6 +124,12 @@
[super finalize];
}
+- (void)dealloc {
+ [super dealloc];
+}
+
+#pragma mark - Bible information
+
- (void)buildBookList {
[moduleLock lock];
Modified: trunk/bindings/objc/src/SwordBook.h
===================================================================
--- trunk/bindings/objc/src/SwordBook.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordBook.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -28,11 +28,12 @@
@property(readwrite, retain) NSMutableDictionary *contents;
-- (id)initWithName:(NSString *)aName swordManager:(SwordManager *)aManager;
-#ifdef __cplusplus
-- (id)initWithSWModule:(sword::SWModule *)aModule swordManager:(SwordManager *)aManager;
-#endif
-
+/**
+ return the tree content for the given treekey
+ the treekey has to be already loaded
+ @param[in]: treekey that we should look for, nil for root
+ @return: SwordTreeEntry
+ */
- (SwordModuleTreeEntry *)treeEntryForKey:(NSString *)treeKey;
@end
Modified: trunk/bindings/objc/src/SwordBook.mm
===================================================================
--- trunk/bindings/objc/src/SwordBook.mm 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordBook.mm 2010-08-01 11:50:46 UTC (rev 2531)
@@ -53,12 +53,6 @@
[super dealloc];
}
-/**
- return the tree content for the given treekey
- the treekey has to be already loaded
- @param[in]: treekey that we should look for, nil for root
- @return: SwordTreeEntry
- */
- (SwordModuleTreeEntry *)treeEntryForKey:(NSString *)treeKey {
SwordModuleTreeEntry * ret = nil;
Modified: trunk/bindings/objc/src/SwordDictionary.h
===================================================================
--- trunk/bindings/objc/src/SwordDictionary.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordDictionary.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -21,11 +21,6 @@
NSMutableArray *keys;
}
-- (id)initWithName:(NSString *)aName swordManager:(SwordManager *)aManager;
-#ifdef __cplusplus
-- (id)initWithSWModule:(sword::SWModule *)aModule swordManager:(SwordManager *)aManager;
-#endif
-
- (NSArray *)allKeys;
- (NSString *)entryForKey:(NSString *)aKey;
Modified: trunk/bindings/objc/src/SwordManager.h
===================================================================
--- trunk/bindings/objc/src/SwordManager.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordManager.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -83,7 +83,7 @@
#define SW_OPTION_GREEKACCENTS @"Greek Accents"
#define SW_OPTION_LEMMAS @"Lemmas"
#define SW_OPTION_SCRIPTREFS @"Cross-references"
-#define SW_OPTION_VARIANTS @"Variants"
+#define SW_OPTION_VARIANTS @"Textual Variants"
#define SW_OPTION_REDLETTERWORDS @"Words of Christ in Red"
// this is not part of Sword
#define SW_OPTION_REF @"Reference"
@@ -132,37 +132,100 @@
// --------------------- methods -----------------------
+/**
+ Conveniance initializer. Creates an instance of SwordManager for a given module path.
+ Internally -initWithPath: is called.
+ */
+ (SwordManager *)managerWithPath:(NSString*)path;
+
+/**
+ Create an instance of SwordManager that will get the default manager
+ in this application.
+ Internally a static reference is set so that this instance will get a singleton object.
+ */
+ (SwordManager *)defaultManager;
-//+ (void)initStringManager;
-+ (void)initLocale;
+/**
+ Retreve a list of known module types.
+ See SWMOD_CATEGORY_*
+ */
+ (NSArray *)moduleTypes;
+
+/**
+ Rendered Module text that has links.
+ This method will return a dictionary with attribute/value pairs from parameters of the link.
+ See ATTRTYPE_* for key types.
+ */
+ (NSDictionary *)linkDataForLinkURL:(NSURL *)aURL;
-/** Constructor */
+/**
+ Initializes this manager for the given module path.
+ */
- (id)initWithPath:(NSString *)path;
+
+/**
+ Add an additional path to the manager to aument more modules.
+ */
- (void)addPath:(NSString*)path;
-- (void)finalize;
-/** reinit the swManager */
+/**
+ reinit - reloads all modules, filters and such
+ This will be triggered if new module had been installed in the module installer.
+ */
- (void)reInit;
+/**
+ Set a cipher key for the given module to make it unlocked and in order to render it's text.
+ */
- (void)setCipherKey:(NSString*)key forModuleNamed:(NSString *)name;
+
+/**
+ Set a global option, for example render option.
+ */
- (void)setGlobalOption:(NSString*)option value:(NSString *)value;
+
+/**
+ Returns the value of an option.
+ */
- (BOOL)globalOption:(NSString *)option;
+/**
+ List of module names known by this manager
+ */
+- (NSArray *)moduleNames;
+
+/**
+ List of modules known by this manager
+ */
- (NSArray *)listModules;
-- (NSArray *)moduleNames;
+
+/**
+ Module list sorted by name
+ */
- (NSArray *)sortedModuleNames;
+
+/**
+ Get module with name from internal list
+ */
- (SwordModule *)moduleWithName:(NSString *)name;
+/**
+ Get modules with certain feature from internal list
+ */
- (NSArray *)modulesForFeature:(NSString *)feature;
+
+/**
+ Get modules with certain type from internal list
+ */
- (NSArray *)modulesForType:(NSString *)type;
#ifdef __cplusplus
- (id)initWithSWMgr:(sword::SWMgr *)smgr;
- (sword::SWModule *)getSWModuleWithName:(NSString *)moduleName;
+
+/**
+ Returns the underlying sword::SWMgr instance
+ */
- (sword::SWMgr *)swManager;
#endif
Modified: trunk/bindings/objc/src/SwordManager.mm
===================================================================
--- trunk/bindings/objc/src/SwordManager.mm 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordManager.mm 2010-08-01 11:50:46 UTC (rev 2531)
@@ -143,9 +143,6 @@
# pragma mark - class methods
+ (NSDictionary *)linkDataForLinkURL:(NSURL *)aURL {
- // there are two types of links
- // our generated sword:// links and study data beginning with applewebdata://
-
NSMutableDictionary *ret = [NSMutableDictionary dictionary];
NSString *scheme = [aURL scheme];
@@ -195,42 +192,6 @@
return ret;
}
-+ (void)initLocale {
- // set locale swManager
- NSString *resourcePath = [[NSBundle bundleForClass:[SwordManager class]] resourcePath];
- NSString *localePath = [resourcePath stringByAppendingPathComponent:@"locales.d"];
- sword::LocaleMgr *lManager = sword::LocaleMgr::getSystemLocaleMgr();
- lManager->loadConfigDir([localePath UTF8String]);
-
- //get the language
- NSArray *availLocales = [NSLocale preferredLanguages];
-
- NSString *lang = nil;
- NSString *loc = nil;
- BOOL haveLocale = NO;
- // for every language, check if we know the locales
- sword::StringList localelist = lManager->getAvailableLocales();
- NSEnumerator *iter = [availLocales objectEnumerator];
- while((loc = [iter nextObject]) && !haveLocale) {
- // check if this locale is available in SWORD
- sword::StringList::iterator it;
- sword::SWBuf locale;
- for(it = localelist.begin(); it != localelist.end(); ++it) {
- locale = *it;
- NSString *swLoc = [NSString stringWithCString:locale.c_str() encoding:NSUTF8StringEncoding];
- if([swLoc hasPrefix:loc]) {
- haveLocale = YES;
- lang = loc;
- break;
- }
- }
- }
-
- if(haveLocale) {
- lManager->setDefaultLocaleName([lang UTF8String]);
- }
-}
-
+ (NSArray *)moduleTypes {
return [NSArray arrayWithObjects:
SWMOD_CATEGORY_BIBLES,
@@ -239,9 +200,6 @@
SWMOD_CATEGORY_GENBOOKS, nil];
}
-/**
- return a manager for the specified path
- */
+ (SwordManager *)managerWithPath:(NSString *)path {
SwordManager *manager = [[[SwordManager alloc] initWithPath:path] autorelease];
return manager;
@@ -257,10 +215,6 @@
return instance;
}
-
-/*
- Initializes Sword Manager with the path to the folder that contains the mods.d, modules.
-*/
- (id)initWithPath:(NSString *)path {
if((self = [super init])) {
@@ -272,9 +226,6 @@
self.modules = [NSDictionary dictionary];
self.managerLock = [[NSRecursiveLock alloc] init];
- // setting locale
- [SwordManager initLocale];
-
[self reInit];
sword::StringList options = swManager->getGlobalOptions();
@@ -287,9 +238,6 @@
return self;
}
-/**
- initialize a new SwordManager with given SWMgr
- */
- (id)initWithSWMgr:(sword::SWMgr *)aSWMgr {
self = [super init];
if(self) {
@@ -306,9 +254,25 @@
return self;
}
-/**
- reinit the swManager
- */
+- (void)finalize {
+ if(!temporaryManager) {
+ delete swManager;
+ }
+
+ [super finalize];
+}
+
+- (void)dealloc {
+ if(!temporaryManager) {
+ delete swManager;
+ }
+ [self setModules:nil];
+ [self setModulesPath:nil];
+ [self setManagerLock:nil];
+
+ [super dealloc];
+}
+
- (void)reInit {
[managerLock lock];
if(modulesPath && [modulesPath length] > 0) {
@@ -354,9 +318,6 @@
[managerLock unlock];
}
-/**
- adds modules in this path
- */
- (void)addPath:(NSString *)path {
[managerLock lock];
@@ -372,31 +333,6 @@
SendNotifyModulesChanged(nil);
}
-/**
- Unloads Sword Manager.
-*/
-- (void)finalize {
- if(!temporaryManager) {
- delete swManager;
- }
-
- [super finalize];
-}
-
-- (void)dealloc {
- if(!temporaryManager) {
- delete swManager;
- }
- [self setModules:nil];
- [self setModulesPath:nil];
- [self setManagerLock:nil];
-
- [super dealloc];
-}
-
-/**
- get module with name from internal list
- */
- (SwordModule *)moduleWithName:(NSString *)name {
SwordModule *ret = [modules objectForKey:name];
@@ -442,9 +378,6 @@
#pragma mark - module access
-/**
- Sets global options such as 'Strongs' or 'Footnotes'.
- */
- (void)setGlobalOption:(NSString *)option value:(NSString *)value {
[managerLock lock];
swManager->setGlobalOption([option UTF8String], [value UTF8String]);
@@ -455,9 +388,6 @@
return [[NSString stringWithUTF8String:swManager->getGlobalOption([option UTF8String])] isEqualToString:SW_ON];
}
-/**
- list all module and return them in a Array
- */
- (NSArray *)listModules {
return [modules allValues];
}
@@ -469,9 +399,6 @@
return [[self moduleNames] sortedArrayUsingSelector:@selector(compare:)];
}
-/**
- Retrieve list of installed modules as an array, where the module has a specific feature
-*/
- (NSArray *)modulesForFeature:(NSString *)feature {
NSMutableArray *ret = [NSMutableArray array];
@@ -488,9 +415,6 @@
return [NSArray arrayWithArray:ret];
}
-/*
- Retrieve list of installed modules as an array, where type is: @"Biblical Texts", @"Commentaries", ..., @"ALL"
-*/
- (NSArray *)modulesForType:(NSString *)type {
NSMutableArray *ret = [NSMutableArray array];
@@ -509,16 +433,10 @@
#pragma mark - lowlevel methods
-/**
- return the sword swManager of this class
- */
- (sword::SWMgr *)swManager {
return swManager;
}
-/**
- Retrieves C++ SWModule pointer - used internally by SwordBible.
- */
- (sword::SWModule *)getSWModuleWithName:(NSString *)moduleName {
sword::SWModule *module = NULL;
Modified: trunk/bindings/objc/src/SwordModule.h
===================================================================
--- trunk/bindings/objc/src/SwordModule.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordModule.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -47,38 +47,8 @@
devotional = 0x0010
}ModuleType;
- at protocol SwordModuleAccess
-/**
- number of entries
- abstract method, should be overriden by subclasses
- */
-- (long)entryCount;
-
-/**
- abstract method, override in subclass
- This method generates stripped text string for a given reference.
- @param[in] reference bible reference
- @return Array of SwordModuleTextEntry instances
- */
-- (NSArray *)strippedTextEntriesForRef:(NSString *)reference;
-
-/**
- abstract method, override in subclass
- This method generates HTML string for a given reference.
- @param[in] reference bible reference
- @return Array of SwordModuleTextEntry instances
- */
-- (NSArray *)renderedTextEntriesForRef:(NSString *)reference;
-
-/**
- write value to reference
- */
-- (void)writeEntry:(SwordModuleTextEntry *)anEntry;
-
- at end
-
- at interface SwordModule : NSObject <SwordModuleAccess> {
+ at interface SwordModule : NSObject {
NSMutableDictionary *configEntries;
ModuleType type;
@@ -106,7 +76,6 @@
@property (retain, readwrite) NSString *name;
@property (retain, readwrite) SwordManager *swManager;
-// -------------- class methods --------------
/**
maps type string to ModuleType enum
@param[in] typeStr type String as in -type(SwordModule)
@@ -116,53 +85,158 @@
// ------------- instance methods ---------------
+/**
+ Initializes module with a given name and SwordManager.
+ The SwordManager is needed because the underlying SWModule is retrieved from SwordManager.
+ */
- (id)initWithName:(NSString *)aName swordManager:(SwordManager *)aManager;
#ifdef __cplusplus
+/**
+ Initialize this module with an the SWModule.
+ This initializer should normally not need to be used.
+ */
- (id)initWithSWModule:(sword::SWModule *)aModule;
+/**
+ Initialize this module with an the SWModule and a SwordManager instance.
+ This initializer should normally not need to be used.
+ */
- (id)initWithSWModule:(sword::SWModule *)aModule swordManager:(SwordManager *)aManager;
+/**
+ Retrieve the underlying SWModule instance
+ */
- (sword::SWModule *)swModule;
#endif
-- (void)finalize;
+/**
+ Any error while processing the module?
+ */
- (NSInteger)error;
+
+// --------------- Conf entries --------------
+
+/**
+ Module description
+ */
- (NSString *)descr;
+/**
+ Module language
+ */
- (NSString *)lang;
+/**
+ Module type as string
+ */
- (NSString *)typeString;
+/**
+ Module version
+ */
- (NSString *)version;
+/**
+ Module minimum Sword version
+ */
- (NSString *)minVersion;
+/**
+ Module about text
+ */
- (NSString *)aboutText;
+/**
+ Module full about text as RTF string
+ */
+- (NSAttributedString *)fullAboutText;
+/**
+ Module versification type
+ */
- (NSString *)versification;
-- (NSAttributedString *)fullAboutText;
+/**
+ Is module Unicode UTF-8?
+ */
- (BOOL)isUnicode;
+/**
+ Is module encrypted
+ */
- (BOOL)isEncrypted;
+/**
+ Is module locked, that is encrypted but not unlocked?
+ */
- (BOOL)isLocked;
+/**
+ Is module editable, i.e. is it's a personal commentary?
+ */
- (BOOL)isEditable;
+/**
+ Is module writing direction Right to Left?
+ */
- (BOOL)isRTL;
+/**
+ Has module this feature?
+ See SWMOD_FEATURE_* in SwordManager
+ */
+- (BOOL)hasFeature:(NSString *)feature;
+/**
+ Returns a config entry for a given config key
+ */
+- (NSString *)configFileEntryForConfigKey:(NSString *)entryKey;
+
+// ------------------ module unlocking ------------------
+
+/**
+ Unlock this module with a cipher key, if it is encrypted.
+ */
- (BOOL)unlock:(NSString *)unlockKey;
-- (void)aquireModuleLock;
-- (void)releaseModuleLock;
+// ------------------ module access semaphores -----------------
-- (BOOL)hasFeature:(NSString *)feature;
-- (NSString *)configFileEntryForConfigKey:(NSString *)entryKey;
+/**
+ Aquires a module access lock so that no other thread may access this module.
+ */
+- (void)lockModuleAccess;
+/**
+ Unlock module access. Make it accessible to other threads.
+ */
+- (void)unlockModuleAccess;
+// ----------------- module positioning ------------------------
+
+/**
+ Increment module key position
+ */
- (void)incKeyPosition;
+/**
+ Decrement module key position
+ */
- (void)decKeyPosition;
+/**
+ Set position key from a string
+ */
- (void)setKeyString:(NSString *)aKeyString;
+/**
+ Set position from a key
+ */
- (void)setKey:(SwordKey *)aKey;
+/**
+ Module key. New instance created by module.
+ */
- (id)createKey;
+/**
+ Module key. Reference only.
+ */
- (id)getKey;
+/**
+ Module key. Reference only but cloned.
+ */
- (id)getKeyCopy;
+// ------------------- module metadata processing ------------------
+
+/**
+ Process metadata attributes of module entry.
+ */
- (void)setProcessEntryAttributes:(BOOL)flag;
+/**
+ Are metadata attributes of module entry processed?
+ */
- (BOOL)processEntryAttributes;
-- (NSString *)renderedText;
-- (NSString *)renderedTextFromString:(NSString *)aString;
-- (NSString *)strippedText;
-- (NSString *)strippedTextFromString:(NSString *)aString;
-
/**
returns attribute values from the engine for notes, cross-refs and such for the given link type
@return NSArray for references
@@ -179,17 +253,60 @@
- (NSArray *)entryAttributeValuesLemma;
+// ----------------- Module text access ----------------------
+
/**
- return a dictionary with key and text
- type can be: "rendered" or "stripped"
+ Retrieves a text entry for a given key.
+ Type can be: "rendered" or "stripped"
*/
- (SwordModuleTextEntry *)textEntryForKey:(SwordKey *)aKey textType:(TextPullType)aType;
+/**
+ Convenience method with a key-string
+ */
- (SwordModuleTextEntry *)textEntryForKeyString:(NSString *)aKeyString textType:(TextPullType)aType;
-// ------- SwordModuleAccess ---------
-- (long)entryCount;
+/**
+ Returns a rendered text for the text at the current module position
+ */
+- (NSString *)renderedText;
+/**
+ Renders the given string with the modules render filters
+ */
+- (NSString *)renderedTextFromString:(NSString *)aString;
+/**
+ Returns a stripped text for the text at the current module position
+ */
+- (NSString *)strippedText;
+/**
+ Strips the given string with the modules strip filters
+ */
+- (NSString *)strippedTextFromString:(NSString *)aString;
+
+/**
+ abstract method, override in subclass
+ This method generates stripped text string for a given reference.
+ @param[in] reference bible reference
+ @return Array of SwordModuleTextEntry instances
+ */
- (NSArray *)strippedTextEntriesForRef:(NSString *)reference;
+
+/**
+ abstract method, override in subclass
+ This method generates HTML string for a given reference.
+ @param[in] reference bible reference
+ @return Array of SwordModuleTextEntry instances
+ */
- (NSArray *)renderedTextEntriesForRef:(NSString *)reference;
+
+/**
+ number of entries
+ abstract method, should be overriden by subclasses
+ */
+- (long)entryCount;
+
+/**
+ Write text to module position
+ */
- (void)writeEntry:(SwordModuleTextEntry *)anEntry;
@end
Modified: trunk/bindings/objc/src/SwordModule.mm
===================================================================
--- trunk/bindings/objc/src/SwordModule.mm 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/src/SwordModule.mm 2010-08-01 11:50:46 UTC (rev 2531)
@@ -29,7 +29,8 @@
@implementation SwordModule
-// -------------- property implementations -----------------
+#pragma mark - Property implementations
+
@synthesize configEntries;
@synthesize type;
@synthesize status;
@@ -64,6 +65,8 @@
return ret;
}
+#pragma mark - Initializers
+
- (void)mainInit {
self.type = [SwordModule moduleTypeForModuleTypeString:[self typeString]];
self.moduleLock = [[NSRecursiveLock alloc] init];
@@ -114,15 +117,17 @@
[super dealloc];
}
-- (void)aquireModuleLock {
+#pragma mark - Module access semaphores
+
+- (void)lockModuleAccess {
[moduleLock lock];
}
-- (void)releaseModuleLock {
+- (void)unlockModuleAccess {
[moduleLock unlock];
}
-#pragma mark - convenience methods
+#pragma mark - Conf entries
/** abstract method. subclasses should handle implementation. */
- (NSAttributedString *)fullAboutText {
@@ -257,7 +262,6 @@
return aboutText;
}
-/** versification scheme in config */
- (NSString *)versification {
NSString *versification = [configEntries objectForKey:SWMOD_CONFENTRY_VERSIFICATION];
if(versification == nil) {
@@ -327,8 +331,8 @@
return encrypted;
}
-/** is module locked/has cipherkey config entry but cipherkey entry is empty */
- (BOOL)isLocked {
+ /** is module locked/has cipherkey config entry but cipherkey entry is empty */
BOOL locked = NO;
NSString *key = [self cipherKey];
if(key != nil) {
@@ -342,6 +346,45 @@
return locked;
}
+// general feature access
+- (BOOL)hasFeature:(NSString *)feature {
+ BOOL has = NO;
+
+ if(swModule->getConfig().has("Feature", [feature UTF8String])) {
+ has = YES;
+ } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"GBF%@", feature] UTF8String])) {
+ has = YES;
+ } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"ThML%@", feature] UTF8String])) {
+ has = YES;
+ } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"UTF8%@", feature] UTF8String])) {
+ has = YES;
+ } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"OSIS%@", feature] UTF8String])) {
+ has = YES;
+ } else if (swModule->getConfig().has("GlobalOptionFilter", [feature UTF8String])) {
+ has = YES;
+ }
+
+ return has;
+}
+
+- (NSString *)configFileEntryForConfigKey:(NSString *)entryKey {
+ NSString *result = nil;
+
+ [moduleLock lock];
+ const char *entryStr = swModule->getConfigEntry([entryKey UTF8String]);
+ if(entryStr) {
+ result = [NSString stringWithUTF8String:entryStr];
+ if(!result) {
+ result = [NSString stringWithCString:entryStr encoding:NSISOLatin1StringEncoding];
+ }
+ }
+ [moduleLock unlock];
+
+ return result;
+}
+
+#pragma mark - Module unlocking
+
- (BOOL)unlock:(NSString *)unlockKey {
if (![self isEncrypted]) {
@@ -358,6 +401,42 @@
return YES;
}
+#pragma mark - Module positioning
+
+- (void)incKeyPosition {
+ swModule->increment(1);
+}
+
+- (void)decKeyPosition {
+ swModule->decrement(1);
+}
+
+- (void)setKeyString:(NSString *)aKeyString {
+ swModule->setKey([aKeyString UTF8String]);
+}
+
+- (void)setKey:(SwordKey *)aKey {
+ swModule->setKey([aKey swKey]);
+}
+
+- (id)createKey {
+ sword::SWKey *sk = swModule->CreateKey();
+ SwordKey *newKey = [SwordKey swordKeyWithSWKey:sk makeCopy:YES];
+ delete sk;
+
+ return newKey;
+}
+
+- (id)getKey {
+ return [SwordKey swordKeyWithSWKey:swModule->getKey()];
+}
+
+- (id)getKeyCopy {
+ return [SwordKey swordKeyWithSWKey:swModule->getKey() makeCopy:YES];
+}
+
+#pragma mark - Module metadata processing
+
- (id)attributeValueForParsedLinkData:(NSDictionary *)data {
id ret = nil;
@@ -385,90 +464,84 @@
return ret;
}
-- (NSString *)description {
- return [self name];
+- (void)setProcessEntryAttributes:(BOOL)flag {
+ swModule->processEntryAttributes(flag);
}
-#pragma mark - SwordModuleAccess
-
-/**
- number of entries
- abstract method, should be overriden by subclasses
- */
-- (long)entryCount {
- return 0;
+- (BOOL)processEntryAttributes {
+ return swModule->isProcessEntryAttributes();
}
-- (NSArray *)strippedTextEntriesForRef:(NSString *)reference {
- NSArray *ret = nil;
+- (NSString *)entryAttributeValuePreverse {
+ NSString *ret = @"";
+ ret = [NSString stringWithUTF8String:swModule->getEntryAttributes()["Heading"]["Preverse"]["0"].c_str()];
- SwordModuleTextEntry *entry = [self textEntryForKey:[SwordKey swordKeyWithRef:reference]
- textType:TextTypeStripped];
- if(entry) {
- ret = [NSArray arrayWithObject:entry];
- }
-
- return ret;
+ return ret;
}
-- (NSArray *)renderedTextEntriesForRef:(NSString *)reference {
- NSArray *ret = nil;
-
- SwordModuleTextEntry *entry = [self textEntryForKey:[SwordKey swordKeyWithRef:reference]
- textType:TextTypeRendered];
- if(entry) {
- ret = [NSArray arrayWithObject:entry];
+- (NSString *)entryAttributeValueFootnoteOfType:(NSString *)fnType indexValue:(NSString *)index {
+ NSString *ret = @"";
+ if([fnType isEqualToString:@"x"]) {
+ ret = [NSString stringWithUTF8String:swModule->getEntryAttributes()["Footnote"][[index UTF8String]]["refList"].c_str()];
+ } else if([fnType isEqualToString:@"n"]) {
+ ret = [NSString stringWithUTF8String:swModule->getEntryAttributes()["Footnote"][[index UTF8String]]["body"].c_str()];
}
-
return ret;
}
-- (void)incKeyPosition {
- swModule->increment(1);
+- (NSArray *)entryAttributeValuesLemma {
+ NSMutableArray *array = [NSMutableArray array];
+
+ // parse entry attributes and look for Lemma (String's numbers)
+ sword::AttributeTypeList::iterator words;
+ sword::AttributeList::iterator word;
+ sword::AttributeValue::iterator strongVal;
+ words = swModule->getEntryAttributes().find("Word");
+ if(words != swModule->getEntryAttributes().end()) {
+ for(word = words->second.begin();word != words->second.end(); word++) {
+ strongVal = word->second.find("Lemma");
+ if(strongVal != word->second.end()) {
+ // pass empty "Text" entries
+ if(strongVal->second == "G3588") {
+ if (word->second.find("Text") == word->second.end())
+ continue; // no text? let's skip
+ }
+ NSMutableString *stringValStr = [NSMutableString stringWithUTF8String:strongVal->second];
+ if(stringValStr) {
+ [stringValStr replaceOccurrencesOfString:@"|x-Strongs:" withString:@" " options:0 range:NSMakeRange(0, [stringValStr length])];
+ [array addObject:stringValStr];
+ }
+ }
+ }
+ }
+ return [NSArray arrayWithArray:array];
}
-- (void)decKeyPosition {
- swModule->decrement(1);
+- (NSString *)entryAttributeValuePreverseForKey:(SwordKey *)aKey {
+ [moduleLock lock];
+ [self setKey:aKey];
+ swModule->RenderText(); // force processing of key
+ NSString *value = [self entryAttributeValuePreverse];
+ [moduleLock unlock];
+ return value;
}
-/**
- subclasses need to implement this
- */
-- (void)writeEntry:(SwordModuleTextEntry *)anEntry {
+- (NSString *)entryAttributeValueFootnoteOfType:(NSString *)fnType indexValue:(NSString *)index forKey:(SwordKey *)aKey {
+ [moduleLock lock];
+ [self setKey:aKey];
+ swModule->RenderText(); // force processing of key
+ NSString *value = [self entryAttributeValueFootnoteOfType:fnType indexValue:index];
+ [moduleLock unlock];
+ return value;
}
-- (void)setKeyString:(NSString *)aKeyString {
- swModule->setKey([aKeyString UTF8String]);
-}
-- (void)setKey:(SwordKey *)aKey {
- swModule->setKey([aKey swKey]);
+- (NSString *)description {
+ return [self name];
}
-- (id)createKey {
- sword::SWKey *sk = swModule->CreateKey();
- SwordKey *newKey = [SwordKey swordKeyWithSWKey:sk makeCopy:YES];
- delete sk;
+#pragma mark - Module text access
- return newKey;
-}
-
-- (id)getKey {
- return [SwordKey swordKeyWithSWKey:swModule->getKey()];
-}
-
-- (id)getKeyCopy {
- return [SwordKey swordKeyWithSWKey:swModule->getKey() makeCopy:YES];
-}
-
-- (void)setProcessEntryAttributes:(BOOL)flag {
- swModule->processEntryAttributes(flag);
-}
-
-- (BOOL)processEntryAttributes {
- return swModule->isProcessEntryAttributes();
-}
-
- (NSString *)renderedText {
NSString *ret = @"";
ret = [NSString stringWithUTF8String:swModule->RenderText()];
@@ -505,53 +578,30 @@
return ret;
}
-- (NSString *)entryAttributeValuePreverse {
- NSString *ret = @"";
- ret = [NSString stringWithUTF8String:swModule->getEntryAttributes()["Heading"]["Preverse"]["0"].c_str()];
+- (NSArray *)strippedTextEntriesForRef:(NSString *)reference {
+ NSArray *ret = nil;
- return ret;
+ SwordModuleTextEntry *entry = [self textEntryForKey:[SwordKey swordKeyWithRef:reference]
+ textType:TextTypeStripped];
+ if(entry) {
+ ret = [NSArray arrayWithObject:entry];
+ }
+
+ return ret;
}
-- (NSString *)entryAttributeValueFootnoteOfType:(NSString *)fnType indexValue:(NSString *)index {
- NSString *ret = @"";
- if([fnType isEqualToString:@"x"]) {
- ret = [NSString stringWithUTF8String:swModule->getEntryAttributes()["Footnote"][[index UTF8String]]["refList"].c_str()];
- } else if([fnType isEqualToString:@"n"]) {
- ret = [NSString stringWithUTF8String:swModule->getEntryAttributes()["Footnote"][[index UTF8String]]["body"].c_str()];
+- (NSArray *)renderedTextEntriesForRef:(NSString *)reference {
+ NSArray *ret = nil;
+
+ SwordModuleTextEntry *entry = [self textEntryForKey:[SwordKey swordKeyWithRef:reference]
+ textType:TextTypeRendered];
+ if(entry) {
+ ret = [NSArray arrayWithObject:entry];
}
+
return ret;
}
-- (NSArray *)entryAttributeValuesLemma {
- NSMutableArray *array = [NSMutableArray array];
-
- // parse entry attributes and look for Lemma (String's numbers)
- sword::AttributeTypeList::iterator words;
- sword::AttributeList::iterator word;
- sword::AttributeValue::iterator strongVal;
- words = swModule->getEntryAttributes().find("Word");
- if(words != swModule->getEntryAttributes().end()) {
- for(word = words->second.begin();word != words->second.end(); word++) {
- strongVal = word->second.find("Lemma");
- if(strongVal != word->second.end()) {
- // pass empty "Text" entries
- if(strongVal->second == "G3588") {
- if (word->second.find("Text") == word->second.end())
- continue; // no text? let's skip
- }
- NSMutableString *stringValStr = [NSMutableString stringWithUTF8String:strongVal->second];
- if(stringValStr) {
- [stringValStr replaceOccurrencesOfString:@"|x-Strongs:" withString:@" " options:0 range:NSMakeRange(0, [stringValStr length])];
- [array addObject:stringValStr];
- }
- }
- }
- }
- return [NSArray arrayWithArray:array];
-}
-
-#pragma mark - Locking methods
-
- (SwordModuleTextEntry *)textEntryForKey:(SwordKey *)aKey textType:(TextPullType)aType {
SwordModuleTextEntry *ret = nil;
@@ -578,68 +628,17 @@
return ret;
}
-/**
- This is just a wrapper method
- */
- (SwordModuleTextEntry *)textEntryForKeyString:(NSString *)aKeyString textType:(TextPullType)aType {
return [self textEntryForKey:[SwordKey swordKeyWithRef:aKeyString] textType:aType];
}
-// general feature access
-- (BOOL)hasFeature:(NSString *)feature {
- BOOL has = NO;
-
- if(swModule->getConfig().has("Feature", [feature UTF8String])) {
- has = YES;
- } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"GBF%@", feature] UTF8String])) {
- has = YES;
- } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"ThML%@", feature] UTF8String])) {
- has = YES;
- } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"UTF8%@", feature] UTF8String])) {
- has = YES;
- } else if (swModule->getConfig().has("GlobalOptionFilter", [[NSString stringWithFormat:@"OSIS%@", feature] UTF8String])) {
- has = YES;
- } else if (swModule->getConfig().has("GlobalOptionFilter", [feature UTF8String])) {
- has = YES;
- }
-
- return has;
-}
-- (NSString *)configFileEntryForConfigKey:(NSString *)entryKey {
- NSString *result = nil;
-
- [moduleLock lock];
- const char *entryStr = swModule->getConfigEntry([entryKey UTF8String]);
- if(entryStr) {
- result = [NSString stringWithUTF8String:entryStr];
- if(!result) {
- result = [NSString stringWithCString:entryStr encoding:NSISOLatin1StringEncoding];
- }
- }
- [moduleLock unlock];
-
- return result;
-}
+- (void)writeEntry:(SwordModuleTextEntry *)anEntry {}
-- (NSString *)entryAttributeValuePreverseForKey:(SwordKey *)aKey {
- [moduleLock lock];
- [self setKey:aKey];
- swModule->RenderText(); // force processing of key
- NSString *value = [self entryAttributeValuePreverse];
- [moduleLock unlock];
- return value;
+- (long)entryCount {
+ return 0;
}
-- (NSString *)entryAttributeValueFootnoteOfType:(NSString *)fnType indexValue:(NSString *)index forKey:(SwordKey *)aKey {
- [moduleLock lock];
- [self setKey:aKey];
- swModule->RenderText(); // force processing of key
- NSString *value = [self entryAttributeValueFootnoteOfType:fnType indexValue:index];
- [moduleLock unlock];
- return value;
-}
-
- (sword::SWModule *)swModule {
return swModule;
}
Modified: trunk/bindings/objc/test/SwordModuleTest.m
===================================================================
--- trunk/bindings/objc/test/SwordModuleTest.m 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/test/SwordModuleTest.m 2010-08-01 11:50:46 UTC (rev 2531)
@@ -47,4 +47,14 @@
STAssertTrue([[text text] length] > 0, @"");
}
+- (void)testCloneModule {
+ SwordBible *bible = (SwordBible *)[[SwordManager defaultManager] moduleWithName:@"GerSch"];
+ STAssertNotNil(bible, @"Module is nil");
+
+ /*
+ SwordBible *cloned = (SwordBible *)[bible clone];
+ STAssertNotNil(cloned, @"Module is nil");
+ */
+}
+
@end
Modified: trunk/bindings/objc/test/Test1.h
===================================================================
--- trunk/bindings/objc/test/Test1.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/test/Test1.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -7,7 +7,7 @@
//
#import <Cocoa/Cocoa.h>
-#import <Test.h>
+#import <SetClassTest.h>
@interface Test1 : NSObject <TestLocal> {
Modified: trunk/bindings/objc/test/TestLocalTest.h
===================================================================
--- trunk/bindings/objc/test/TestLocalTest.h 2010-07-26 11:25:20 UTC (rev 2530)
+++ trunk/bindings/objc/test/TestLocalTest.h 2010-08-01 11:50:46 UTC (rev 2531)
@@ -7,7 +7,7 @@
//
#import <SenTestingKit/SenTestingKit.h>
-#import <Test.h>
+#import <SetClassTest.h>
#import <Test1.h>
@interface TestLocalTest : SenTestCase {
More information about the sword-cvs
mailing list