Skip to content

Commit 7c29df5

Browse files
author
Jérôme Lebel
committed
1 parent 1132af9 commit 7c29df5

File tree

6 files changed

+422
-0
lines changed

6 files changed

+422
-0
lines changed

MongoObjCDriver.xcodeproj/project.pbxproj

+12
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
02BDC3E7141D6073000EF755 /* MODCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 02BDC3E5141D6073000EF755 /* MODCursor.h */; settings = {ATTRIBUTES = (Public, ); }; };
8181
02BDC3E8141D6073000EF755 /* MODCursor.m in Sources */ = {isa = PBXBuildFile; fileRef = 02BDC3E6141D6073000EF755 /* MODCursor.m */; };
8282
02BDC3EC141D83A7000EF755 /* MODClient_utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 02BDC3EB141D83A7000EF755 /* MODClient_utils.m */; };
83+
02C345251A40D51F004F0D2C /* MODIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = 02C345231A40D51F004F0D2C /* MODIndex.h */; settings = {ATTRIBUTES = (Public, ); }; };
84+
02C345261A40D51F004F0D2C /* MODIndex.m in Sources */ = {isa = PBXBuildFile; fileRef = 02C345241A40D51F004F0D2C /* MODIndex.m */; };
85+
02C345281A40DEC8004F0D2C /* MODIndex-private.h in Headers */ = {isa = PBXBuildFile; fileRef = 02C345271A40DEB5004F0D2C /* MODIndex-private.h */; settings = {ATTRIBUTES = (Private, ); }; };
8386
02CCE7A0192A278800A9DB1B /* MODRagelJsonParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 0299B61117F39FA200FB40A2 /* MODRagelJsonParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
8487
02CF0E20191112CB008C822A /* bcon.c in Sources */ = {isa = PBXBuildFile; fileRef = 0204505F190E5EB000A80BED /* bcon.c */; };
8588
02CF0E21191112CB008C822A /* bson-atomic.c in Sources */ = {isa = PBXBuildFile; fileRef = 02045061190E5EB000A80BED /* bson-atomic.c */; };
@@ -1425,6 +1428,9 @@
14251428
02BDC3E5141D6073000EF755 /* MODCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MODCursor.h; sourceTree = "<group>"; };
14261429
02BDC3E6141D6073000EF755 /* MODCursor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MODCursor.m; sourceTree = "<group>"; };
14271430
02BDC3EB141D83A7000EF755 /* MODClient_utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MODClient_utils.m; sourceTree = "<group>"; };
1431+
02C345231A40D51F004F0D2C /* MODIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MODIndex.h; sourceTree = "<group>"; };
1432+
02C345241A40D51F004F0D2C /* MODIndex.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MODIndex.m; sourceTree = "<group>"; };
1433+
02C345271A40DEB5004F0D2C /* MODIndex-private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MODIndex-private.h"; sourceTree = "<group>"; };
14281434
02CF0EA01911326B008C822A /* mongoc-stream-apple-tls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mongoc-stream-apple-tls.c"; sourceTree = "<group>"; };
14291435
02CF0EA519191117008C822A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
14301436
02CF0EA919192608008C822A /* libsasl2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsasl2.dylib; path = usr/lib/libsasl2.dylib; sourceTree = SDKROOT; };
@@ -2945,6 +2951,9 @@
29452951
02688DDB14119CF50014ED51 /* MODDatabase.m */,
29462952
02688DE01411C5010014ED51 /* MODCollection.h */,
29472953
02688DE11411C5010014ED51 /* MODCollection.m */,
2954+
02C345231A40D51F004F0D2C /* MODIndex.h */,
2955+
02C345271A40DEB5004F0D2C /* MODIndex-private.h */,
2956+
02C345241A40D51F004F0D2C /* MODIndex.m */,
29482957
02F4EA8519F1C39B00BE9695 /* MODBulkOperation.h */,
29492958
02F4EA8619F1C39B00BE9695 /* MODBulkOperation.m */,
29502959
02BDC3E5141D6073000EF755 /* MODCursor.h */,
@@ -3056,6 +3065,7 @@
30563065
027A1DA51767E91F0048AD60 /* MODMinKey.h in Headers */,
30573066
027A1DA81767E91F0048AD60 /* MODUndefined.h in Headers */,
30583067
02CCE7A0192A278800A9DB1B /* MODRagelJsonParser.h in Headers */,
3068+
02C345281A40DEC8004F0D2C /* MODIndex-private.h in Headers */,
30593069
02AB33AC194870D6008C06B9 /* MODReadPreferences.h in Headers */,
30603070
02A85F5D14104373004F3FE9 /* MongoObjCDriver-private.h in Headers */,
30613071
025410A819AA7FCE00CF437E /* MODSSLOptions.h in Headers */,
@@ -3128,6 +3138,7 @@
31283138
02D3D3381926661300925BE7 /* mongoc-stream.h in Headers */,
31293139
02D3D3391926661300925BE7 /* mongoc-thread-private.h in Headers */,
31303140
02D3D33A1926661300925BE7 /* mongoc-trace.h in Headers */,
3141+
02C345251A40D51F004F0D2C /* MODIndex.h in Headers */,
31313142
02D3D33B1926661300925BE7 /* mongoc-uri.h in Headers */,
31323143
02D3D33C1926661400925BE7 /* mongoc-util-private.h in Headers */,
31333144
02D3D33D1926661400925BE7 /* mongoc-write-command-private.h in Headers */,
@@ -3329,6 +3340,7 @@
33293340
025C56201433E7E40064B010 /* MODDBPointer.m in Sources */,
33303341
02CF0E7819111321008C822A /* mongoc-index.c in Sources */,
33313342
02B24274147D1BD6008A15A3 /* MODSortedMutableDictionary.m in Sources */,
3343+
02C345261A40D51F004F0D2C /* MODIndex.m in Sources */,
33323344
02CF0E9F19112271008C822A /* yajl_version.c in Sources */,
33333345
02B13FA81949C41000EFF763 /* MODFunction.m in Sources */,
33343346
023ECFFD14851BEE00185781 /* MODSymbol.m in Sources */,

Sources/MODIndex-private.h

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//
2+
// MODIndex-private.h
3+
// MongoObjCDriver
4+
//
5+
// Created by Jérôme Lebel on 16/12/2014.
6+
//
7+
//
8+
9+
#import "MongoObjCDriver-private.h"
10+
11+
@interface MODIndexOptGeo()
12+
@property (nonatomic, readwrite, assign) mongoc_index_opt_geo_t *mongocIndexOptGeo;
13+
14+
+ (instancetype)indexOptGeoWithMongocIndexOptGeo:(const mongoc_index_opt_geo_t *)mongocIndexOptGeo;
15+
16+
- (instancetype)initWithMongocIndexOptGeo:(const mongoc_index_opt_geo_t *)mongocIndexOptGeo;
17+
@end
18+
19+
@interface MODIndexOpt()
20+
+ (instancetype)indexOptWithMongocIndexOpt:(const mongoc_index_opt_t *)mongocIndexOpt;
21+
22+
- (instancetype)initWithMongocIndexOpt:(const mongoc_index_opt_t *)mongocIndexOpt;
23+
24+
- (void)setMongocIndexOpt:(const mongoc_index_opt_t *)mongocIndexOpt;
25+
- (mongoc_index_opt_t *)mongocIndexOpt;
26+
@end

Sources/MODIndex.h

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
//
2+
// MODIndex.h
3+
// MongoObjCDriver
4+
//
5+
// Created by Jérôme Lebel on 16/12/2014.
6+
//
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@class MODSortedDictionary;
12+
13+
@interface MODIndexOptGeo : NSObject
14+
{
15+
void *_mongocIndexOptGeo;
16+
}
17+
@property (nonatomic, readwrite, assign) uint8_t twodSphereVersion;
18+
@property (nonatomic, readwrite, assign) uint8_t twodBitsPrecision;
19+
@property (nonatomic, readwrite, assign) double twodLocationMin;
20+
@property (nonatomic, readwrite, assign) double twodLocationMax;
21+
@property (nonatomic, readwrite, assign) double haystackBucketSize;
22+
23+
- (instancetype)init;
24+
- (instancetype)initWithTwodSphereVersion:(uint8_t)twodSphereVersion
25+
twodBitsPercision:(uint8_t)twodBitsPercision
26+
twodLocationMin:(double)twodLocationMin
27+
twodLocationMax:(double)twodLocationMax
28+
haystackBucketSize:(double)haystackBucketSize;
29+
30+
@end
31+
32+
@interface MODIndexOpt : NSObject
33+
{
34+
MODIndexOptGeo *_geoOptions;
35+
void *_mongocIndexOpt;
36+
}
37+
@property (nonatomic, readwrite, assign) BOOL isInitialized;
38+
@property (nonatomic, readwrite, assign) BOOL background;
39+
@property (nonatomic, readwrite, assign) BOOL unique;
40+
@property (nonatomic, readwrite, strong) NSString *name;
41+
@property (nonatomic, readwrite, assign) BOOL dropDups;
42+
@property (nonatomic, readwrite, assign) BOOL sparse;
43+
@property (nonatomic, readwrite, assign) int32_t expireAfterSeconds;
44+
@property (nonatomic, readwrite, assign) int32_t v;
45+
@property (nonatomic, readwrite, strong) MODSortedDictionary *weights;
46+
@property (nonatomic, readwrite, strong) NSString *defaultLanguage;
47+
@property (nonatomic, readwrite, strong) NSString *languageOverride;
48+
@property (nonatomic, readwrite, strong) MODIndexOptGeo *geoOptions;
49+
50+
- (instancetype)init;
51+
52+
@end
53+

0 commit comments

Comments
 (0)