Skip to content
Browse files

Initial push

  • Loading branch information...
0 parents commit 9fd3f009cd5f4754c0ad9fd832fef0cca989f048 @gerald-lindsly committed
Showing with 1,130 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +663 −0 Bson.pas
  3. +36 −0 MongoDelphiDriver.dpk
  4. +164 −0 MongoDelphiDriver.dproj
  5. +48 −0 MongoDelphiDriver.groupproj
  6. BIN MongoDelphiDriver.res
  7. +67 −0 Test.dpr
  8. +144 −0 Test.dproj
  9. BIN Test.res
8 .gitignore
@@ -0,0 +1,8 @@
+Win32/
+Win64/
+__history
+MongoDelphiDriver.dproj.local
+MongoDelphiDriver.groupproj.local
+MongoDelphiDriver.identcache
+Test.dproj.local
+Test.identcache
663 Bson.pas
@@ -0,0 +1,663 @@
+unit Bson;
+
+interface
+ type TBson = class;
+
+ TBsonType = (
+ bsonEOO = 0,
+ bsonDOUBLE = 1,
+ bsonSTRING = 2,
+ bsonOBJECT = 3,
+ bsonARRAY = 4,
+ bsonBINDATA = 5,
+ bsonUNDEFINED = 6,
+ bsonOID = 7,
+ bsonBOOL = 8,
+ bsonDATE = 9,
+ bsonNULL = 10,
+ bsonREGEX = 11,
+ bsonDBREF = 12, (* Deprecated. *)
+ bsonCODE = 13,
+ bsonSYMBOL = 14,
+ bsonCODEWSCOPE = 15,
+ bsonINT = 16,
+ bsonTIMESTAMP = 17,
+ bsonLONG = 18);
+
+ TBsonIterator = class;
+
+ TBsonOID = class(TObject)
+ var
+ value : array[0..11] of Byte;
+ constructor Create(); overload;
+ constructor Create(s : PAnsiChar); overload;
+ constructor Create(i : TBsonIterator); overload;
+ function AsString() : string;
+ end;
+
+ TBsonCodeWScope = class(TObject)
+ var
+ code : string;
+ scope : TBson;
+ constructor Create(code_ : string; scope_ : TBson); overload;
+ constructor Create(i : TBsonIterator); overload;
+ end;
+
+ TBsonRegex = class(TObject)
+ var
+ pattern : string;
+ options : string;
+ constructor Create(pattern_ : string; options_ : string); overload;
+ constructor Create(i : TBsonIterator); overload;
+ end;
+
+ TBsonTimestamp = class(TObject)
+ var
+ time : TDateTime;
+ increment : Integer;
+ constructor Create(time_ : TDateTime; increment_ : Integer); overload;
+ constructor Create(i : TBsonIterator); overload;
+ end;
+
+ TBsonBinary = class(TObject)
+ var
+ data : Pointer;
+ len : Integer;
+ kind : Integer;
+ constructor Create(p : Pointer; length : Integer); overload;
+ constructor Create(i : TBsonIterator); overload;
+ destructor Destroy(); override;
+ end;
+
+ TBsonBuffer = class(TObject)
+ private
+ var handle : Pointer;
+ public
+ function append(name : PAnsiChar; value : PAnsiChar) : Boolean; overload;
+ function append(name : PAnsiChar; value : Integer) : Boolean; overload;
+ function append(name : PAnsiChar; value : Int64) : Boolean; overload;
+ function append(name : PAnsiChar; value : Double) : Boolean; overload;
+ function append(name : PAnsiChar; value : TDateTime) : Boolean; overload;
+ function append(name : PAnsiChar; value : Boolean) : Boolean; overload;
+ function append(name : PAnsiChar; value : TBsonOID) : Boolean; overload;
+ function append(name : PAnsiChar; value : TBsonCodeWScope) : Boolean; overload;
+ function append(name : PAnsiChar; value : TBsonRegex) : Boolean; overload;
+ function append(name : PAnsiChar; value : TBsonTimestamp) : Boolean; overload;
+ function append(name : PAnsiChar; value : TBsonBinary) : Boolean; overload;
+ function appendCode(name : PAnsiChar; value : PAnsiChar) : Boolean;
+ function appendSymbol(name : PAnsiChar; value : PAnsiChar) : Boolean;
+ function appendBinary(name : PAnsiChar; kind : Integer; data : Pointer; length : Integer) : Boolean;
+ function startObject(name : PAnsiChar) : Boolean;
+ function startArray(name : PAnsiChar) : Boolean;
+ function finishObject() : Boolean;
+ function size() : Integer;
+ function finish() : TBson;
+ constructor Create();
+ destructor Destroy(); override;
+ end;
+
+ TBson = class(TObject)
+ private
+ var handle : Pointer;
+ public
+ function size() : Integer;
+ function iterator() : TBsonIterator;
+ function find(name : PAnsiChar) : TBsonIterator;
+ function value(name : PAnsiChar) : Variant;
+ procedure display();
+ constructor Create(h : Pointer);
+ destructor Destroy; override;
+ end;
+
+ TBsonIterator = class(TObject)
+ private
+ var handle : Pointer;
+ public
+ function kind() : TBsonType;
+ function key() : PAnsiChar;
+ function next() : Boolean;
+ function value() : Variant;
+ function subiterator() : TBsonIterator;
+ function getOID() : TBsonOID;
+ function getCodeWScope() : TBsonCodeWScope;
+ function getRegex() : TBsonRegex;
+ function getTimestamp() : TBsonTimestamp;
+ function getBinary() : TBsonBinary;
+ constructor Create(); overload;
+ constructor Create(b : TBson); overload;
+ destructor Destroy; override;
+ end;
+
+ function ByteToHex(InByte : Byte) : string;
+
+implementation
+ uses SysUtils, Variants;
+
+ function bson_create() : Pointer; external 'mongoc.dll';
+ procedure bson_init(b : Pointer); cdecl; external 'mongoc.dll';
+ procedure bson_destroy(b : Pointer); cdecl; external 'mongoc.dll';
+ procedure bson_dispose(b : Pointer); cdecl; external 'mongoc.dll';
+ procedure bson_copy(dest : Pointer; src : Pointer); cdecl; external 'mongoc.dll';
+ function bson_finish(b : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ procedure bson_oid_gen(oid : Pointer); cdecl; external 'mongoc.dll';
+ procedure bson_oid_to_string(oid : Pointer; s : PAnsiChar); cdecl; external 'mongoc.dll';
+ procedure bson_oid_from_string(oid : Pointer; s : PAnsiChar); cdecl; external 'mongoc.dll';
+ function bson_append_string(b : Pointer; name : PAnsiChar; value : PAnsiChar) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_code(b : Pointer; name : PAnsiChar; value : PAnsiChar) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_symbol(b : Pointer; name : PAnsiChar; value : PAnsiChar) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_int(b : Pointer; name : PAnsiChar; value : Integer) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_long(b : Pointer; name : PAnsiChar; value : Int64) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_double(b : Pointer; name : PAnsiChar; value : Double) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_date(b : Pointer; name : PAnsiChar; value : Int64) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_bool(b : Pointer; name : PAnsiChar; value : Boolean) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_start_object(b : Pointer; name : PAnsiChar) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_start_array(b : Pointer; name : PAnsiChar) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_finish_object(b : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_append_oid(b : Pointer; name : PAnsiChar; oid : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_append_code_w_scope(b : Pointer; name : PAnsiChar; code : PAnsiChar; scope : Pointer) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_regex(b : Pointer; name : PAnsiChar; pattern : PAnsiChar; options : PAnsiChar) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_timestamp2(b : Pointer; name : PAnsiChar; time : Integer; increment : Integer) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_append_binary(b : Pointer; name : PAnsiChar; kind : Byte; data : Pointer; len : Integer) : Integer;
+ cdecl; external 'mongoc.dll';
+ function bson_buffer_size(b : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_size(b : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_iterator_create() : Pointer; external 'mongoc.dll';
+ procedure bson_iterator_dispose(i : Pointer); external 'mongoc.dll';
+ procedure bson_iterator_init(i : Pointer; b : Pointer); cdecl; external 'mongoc.dll';
+ function bson_find(i : Pointer; b : Pointer; name : PAnsiChar) : TBsonType;
+ cdecl; external 'mongoc.dll';
+ function bson_iterator_type(i : Pointer) : TBsonType; cdecl; external 'mongoc.dll';
+ function bson_iterator_next(i : Pointer) : TBsonType; cdecl; external 'mongoc.dll';
+ function bson_iterator_key(i : Pointer) : PAnsiChar; cdecl; external 'mongoc.dll';
+ function bson_iterator_double(i : Pointer) : Double; cdecl; external 'mongoc.dll';
+ function bson_iterator_long(i : Pointer) : Int64; cdecl; external 'mongoc.dll';
+ function bson_iterator_int(i : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_iterator_bool(i : Pointer) : Boolean; cdecl; external 'mongoc.dll';
+ function bson_iterator_string(i : Pointer) : PAnsiChar; cdecl; external 'mongoc.dll';
+ function bson_iterator_date(i : Pointer) : Int64; cdecl; external 'mongoc.dll';
+ procedure bson_iterator_subiterator(i : Pointer; sub : Pointer);
+ cdecl; external 'mongoc.dll';
+ function bson_iterator_oid(i : Pointer) : Pointer; cdecl; external 'mongoc.dll';
+ function bson_iterator_code(i : Pointer) : PAnsiChar; cdecl; external 'mongoc.dll';
+ procedure bson_iterator_code_scope(i : Pointer; b : Pointer); cdecl; external 'mongoc.dll';
+ function bson_iterator_regex(i : Pointer) : PAnsiChar; cdecl; external 'mongoc.dll';
+ function bson_iterator_regex_opts(i : Pointer) : PAnsiChar; cdecl; external 'mongoc.dll';
+ function bson_iterator_timestamp_time(i : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_iterator_timestamp_increment(i : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_iterator_bin_len(i : Pointer) : Integer; cdecl; external 'mongoc.dll';
+ function bson_iterator_bin_type(i : Pointer) : Byte; cdecl; external 'mongoc.dll';
+ function bson_iterator_bin_data(i : Pointer) : Pointer; cdecl; external 'mongoc.dll';
+
+ function Int64ToDouble(i64 : int64) : double; cdecl; external 'mongoc.dll';
+
+ constructor TBsonOID.Create();
+ begin
+ bson_oid_gen(@value);
+ end;
+
+ constructor TBsonOID.Create(s : PAnsiChar);
+ begin
+ if length(s) <> 24 then
+ Raise Exception.Create('Expected a 24 digit hex string');
+ bson_oid_from_string(@value, s);
+ end;
+
+ constructor TBsonOID.Create(i : TBsonIterator);
+ var
+ p : PByte;
+ begin
+ p := bson_iterator_oid(i.handle);
+ Move(p^, value, 12);
+ end;
+
+ function TBsonOID.AsString() : string;
+ var
+ buf : array[0..24] of AnsiChar;
+ begin
+ bson_oid_to_string(@value, @buf);
+ Result := string(buf);
+ end;
+
+ constructor TBsonIterator.Create();
+ begin
+ inherited Create();
+ handle := bson_iterator_create();
+ end;
+
+ constructor TBsonIterator.Create(b : TBson);
+ begin
+ inherited Create();
+ handle := bson_iterator_create();
+ bson_iterator_init(handle, b.handle);
+ end;
+
+ destructor TBsonIterator.Destroy;
+ begin
+ bson_iterator_dispose(handle);
+ end;
+
+ function TBsonIterator.kind() : TBsonType;
+ begin
+ Result := bson_iterator_type(handle);
+ end;
+
+ function TBsonIterator.next() : Boolean;
+ begin
+ Result := bson_iterator_next(handle) <> bsonEOO;
+ end;
+
+ function TBsonIterator.key() : PAnsiChar;
+ begin
+ Result := bson_iterator_key(handle);
+ end;
+
+ function TBsonIterator.value() : Variant;
+ var
+ k : TBsonType;
+ d : TDateTime;
+ begin
+ k := kind();
+ case k of
+ bsonEOO, bsonNULL : Result := Null;
+ bsonDOUBLE: Result := bson_iterator_double(handle);
+ bsonSTRING, bsonCODE, bsonSYMBOL:
+ Result := string(bson_iterator_string(handle));
+ bsonINT: Result := bson_iterator_int(handle);
+ bsonBOOL: Result := bson_iterator_bool(handle);
+ bsonDATE: begin
+ d := Int64ToDouble(bson_iterator_date(handle)) / (1000 * 24 * 60 * 60) + 25569;
+ Result := d;
+ end;
+ bsonLONG: Result := bson_iterator_long(handle);
+ else
+ Raise Exception.Create('BsonType (' + IntToStr(Ord(k)) + ') not supported by TBsonIterator.value');
+ end;
+ end;
+
+ function TBsonIterator.getOID() : TBsonOID;
+ begin
+ Result := TBsonOID.Create(Self);
+ end;
+
+ function TBsonIterator.getCodeWScope() : TBsonCodeWScope;
+ begin
+ Result := TBsonCodeWScope.Create(Self);
+ end;
+
+ function TBsonIterator.getRegex() : TBsonRegex;
+ begin
+ Result := TBsonRegex.Create(Self);
+ end;
+
+ function TBsonIterator.getTimestamp() : TBsonTimestamp;
+ begin
+ Result := TBsonTimestamp.Create(Self);
+ end;
+
+ function TBsonIterator.getBinary() : TBsonBinary;
+ begin
+ Result := TBsonBinary.Create(Self);
+ end;
+
+ function TBsonIterator.subiterator() : TBsonIterator;
+ var
+ i : TBsonIterator;
+ begin
+ i := TBsonIterator.Create();
+ bson_iterator_subiterator(handle, i.handle);
+ Result := i;
+ end;
+
+ function TBson.value(name: PAnsiChar) : Variant;
+ var
+ i : TBsonIterator;
+ begin
+ i := find(name);
+ if i = nil then
+ Result := Null
+ else
+ Result := i.value;
+ end;
+
+ function TBson.iterator() : TBsonIterator;
+ begin
+ Result := TBsonIterator.Create(Self);
+ end;
+
+ constructor TBsonBuffer.Create();
+ begin
+ inherited Create();
+ handle := bson_create();
+ bson_init(handle);
+ end;
+
+ destructor TBsonBuffer.Destroy();
+ begin
+ bson_destroy(handle);
+ bson_dispose(handle);
+ inherited Destroy();
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: PAnsiChar) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_string(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.appendCode(name: PAnsiChar; value: PAnsiChar) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_code(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.appendSymbol(name: PAnsiChar; value: PAnsiChar) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_symbol(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: Integer) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_int(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: Int64) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_long(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: Double) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_double(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: TDateTime) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_date(handle, name, Trunc((value - 25569) * 1000 * 60 * 60 * 24)) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: Boolean) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_bool(handle, name, value) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: TBsonOID) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_oid(handle, name, @value.value) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: TBsonCodeWScope) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_code_w_scope(handle, name, PAnsiChar(AnsiString(value.code)), value.scope.handle) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: TBsonRegex) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_regex(handle, name, PAnsiChar(AnsiString(value.pattern)), PAnsiChar(AnsiString(value.options))) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: TBsonTimestamp) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_timestamp2(handle, name, Trunc((value.time - 25569) * 60 * 60 * 24), value.increment) = 0);
+ end;
+
+ function TBsonBuffer.append(name: PAnsiChar; value: TBsonBinary) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_binary(handle, name, value.kind, value.data, value.len) = 0);
+ end;
+
+ function TBsonBuffer.appendBinary(name : PAnsiChar; kind : Integer; data : Pointer; length : Integer) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_binary(handle, name, kind, data, length) = 0);
+ end;
+
+ function TBsonBuffer.startObject(name: PAnsiChar) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_start_object(handle, name) = 0);
+ end;
+
+ function TBsonBuffer.startArray(name: PAnsiChar) : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_start_array(handle, name) = 0);
+ end;
+
+ function TBsonBuffer.finishObject() : Boolean;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := (bson_append_finish_object(handle) = 0);
+ end;
+
+ function TBsonBuffer.size() : Integer;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ Result := bson_buffer_size(handle);
+ end;
+
+ function TBsonBuffer.finish() : TBson;
+ begin
+ if handle = nil then
+ raise Exception.Create('BsonBuffer already finished');
+ if bson_finish(handle) = 0 Then begin
+ Result := TBson.Create(handle);
+ handle := nil;
+ end
+ else
+ Result := nil;
+ end;
+
+ constructor TBson.Create(h : Pointer);
+ begin
+ handle := h;
+ end;
+
+ destructor TBson.Destroy();
+ begin
+ bson_destroy(handle);
+ bson_dispose(handle);
+ inherited Destroy();
+ end;
+
+ function TBson.size() : Integer;
+ begin
+ Result := bson_size(handle);
+ end;
+
+ function TBson.find(name : PAnsiChar) : TBsonIterator;
+ var
+ i : TBsonIterator;
+ begin
+ i := TBsonIterator.Create();
+ if bson_find(i.handle, handle, name) = bsonEOO Then
+ i := nil;
+ Result := i;
+ end;
+
+ procedure _display(i : TBsonIterator; depth : Integer);
+ var
+ t : TBsonType;
+ j,k : Integer;
+ cws : TBsonCodeWScope;
+ regex : TBsonRegex;
+ ts : TBsonTimestamp;
+ bin : TBsonBinary;
+ p : PByte;
+ begin
+ while i.next() do begin
+ t := i.kind();
+ if t = bsonEOO then
+ break;
+ for j:= 1 To depth do
+ Write(' ');
+ Write(i.key, ' (', Ord(t), ') : ');
+ case t of
+ bsonDOUBLE,
+ bsonSTRING, bsonSYMBOL, bsonCODE,
+ bsonBOOL, bsonDATE, bsonINT, bsonLONG :
+ Write(i.value);
+ bsonUNDEFINED :
+ Write('UNDEFINED');
+ bsonNULL :
+ Write('NULL');
+ bsonOBJECT, bsonARRAY : begin
+ Writeln;
+ _display(i.subiterator, depth+1);
+ end;
+ bsonOID : write(i.getOID().AsString());
+ bsonCODEWSCOPE : begin
+ Write('CODEWSCOPE ');
+ cws := i.getCodeWScope();
+ WriteLn(cws.code);
+ _display(cws.scope.iterator, depth+1);
+ end;
+ bsonREGEX: begin
+ regex := i.getRegex();
+ write(regex.pattern, ', ', regex.options);
+ end;
+ bsonTIMESTAMP: begin
+ ts := i.getTimestamp();
+ write(DateTimeToStr(ts.time), ' (', ts.increment, ')');
+ end;
+ bsonBINDATA: begin
+ bin := i.getBinary();
+ Write('BINARY (', bin.kind, ')');
+ p := bin.data;
+ for j := 0 to bin.len-1 do begin
+ if j and 15 = 0 then begin
+ WriteLn;
+ for k := 1 To depth+1 do
+ Write(' ');
+ end;
+ write(ByteToHex(p^), ' ');
+ Inc(p);
+ end;
+ end;
+ else
+ Write('UNKNOWN');
+ end;
+ Writeln;
+ end;
+ end;
+
+ procedure TBson.display();
+ begin
+ _display(iterator, 0);
+ end;
+
+ constructor TBsonCodeWScope.Create(code_ : string; scope_ : TBson);
+ begin
+ code := code_;
+ scope := scope_;
+ end;
+
+ constructor TBsonCodeWScope.Create(i : TBsonIterator);
+ var
+ b, c : Pointer;
+ begin
+ code := string(bson_iterator_code(i.handle));
+ b := bson_create();
+ bson_iterator_code_scope(i.handle, b);
+ c := bson_create();
+ bson_copy(c, b);
+ scope := TBson.Create(c);
+ bson_dispose(b);
+ end;
+
+ constructor TBsonRegex.Create(pattern_ : string; options_ : string);
+ begin
+ pattern := pattern_;
+ options := options_;
+ end;
+
+ constructor TBsonRegex.Create(i : TBsonIterator);
+ begin
+ pattern := string(bson_iterator_regex(i.handle));
+ options := string(bson_iterator_regex_opts(i.handle));
+ end;
+
+
+ constructor TBsonTimestamp.Create(time_ : TDateTime; increment_ : Integer);
+ begin
+ time := time_;
+ increment := increment_;
+ end;
+
+ constructor TBsonTimestamp.Create(i : TBsonIterator);
+ begin
+ time := bson_iterator_timestamp_time(i.handle) / (60.0 * 60 * 24) + 25569;
+ increment := bson_iterator_timestamp_increment(i.handle);
+ end;
+
+ constructor TBsonBinary.Create(p: Pointer; length: Integer);
+ begin
+ GetMem(data, length);
+ Move(p^, data^, length);
+ kind := 0;
+ end;
+
+ constructor TBsonBinary.Create(i : TBsonIterator);
+ var
+ p : Pointer;
+ begin
+ kind := bson_iterator_bin_type(i.handle);
+ len := bson_iterator_bin_len(i.handle);
+ p := bson_iterator_bin_data(i.handle);
+ GetMem(data, len);
+ Move(p^, data^, len);
+ end;
+
+ destructor TBsonBinary.Destroy;
+ begin
+ FreeMem(data);
+ end;
+
+ function ByteToHex(InByte : Byte) : string;
+ const digits : array[0..15] of Char = '0123456789ABCDEF';
+ begin
+ result := digits[InByte shr 4] + digits[InByte and $0F];
+ end;
+
+end.
36 MongoDelphiDriver.dpk
@@ -0,0 +1,36 @@
+package MongoDelphiDriver;
+
+{$R *.res}
+{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users}
+{$ALIGN 8}
+{$ASSERTIONS ON}
+{$BOOLEVAL OFF}
+{$DEBUGINFO ON}
+{$EXTENDEDSYNTAX ON}
+{$IMPORTEDDATA ON}
+{$IOCHECKS ON}
+{$LOCALSYMBOLS ON}
+{$LONGSTRINGS ON}
+{$OPENSTRINGS ON}
+{$OPTIMIZATION OFF}
+{$OVERFLOWCHECKS OFF}
+{$RANGECHECKS OFF}
+{$REFERENCEINFO ON}
+{$SAFEDIVIDE OFF}
+{$STACKFRAMES ON}
+{$TYPEDADDRESS OFF}
+{$VARSTRINGCHECKS ON}
+{$WRITEABLECONST OFF}
+{$MINENUMSIZE 1}
+{$IMAGEBASE $400000}
+{$DEFINE DEBUG}
+{$ENDIF IMPLICITBUILDING}
+{$IMPLICITBUILD ON}
+
+requires
+ rtl;
+
+contains
+ Bson in 'Bson.pas';
+
+end.
164 MongoDelphiDriver.dproj
@@ -0,0 +1,164 @@
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{F9C9AC27-5CCA-400D-97FA-2E6931FA838E}</ProjectGuid>
+ <MainSource>MongoDelphiDriver.dpk</MainSource>
+ <ProjectVersion>13.4</ProjectVersion>
+ <FrameworkType>None</FrameworkType>
+ <Base>True</Base>
+ <Config Condition="'$(Config)'==''">Debug</Config>
+ <Platform Condition="'$(Platform)'==''">Win64</Platform>
+ <TargetedPlatforms>3</TargetedPlatforms>
+ <AppType>Package</AppType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+ <Base_Win64>true</Base_Win64>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+ <Base_Win32>true</Base_Win32>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
+ <Cfg_1>true</Cfg_1>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
+ <Cfg_1_Win64>true</Cfg_1_Win64>
+ <CfgParent>Cfg_1</CfgParent>
+ <Cfg_1>true</Cfg_1>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+ <Cfg_1_Win32>true</Cfg_1_Win32>
+ <CfgParent>Cfg_1</CfgParent>
+ <Cfg_1>true</Cfg_1>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+ <Cfg_2>true</Cfg_2>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base)'!=''">
+ <DCC_CBuilderOutput>All</DCC_CBuilderOutput>
+ <GenPackage>true</GenPackage>
+ <GenDll>true</GenDll>
+ <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
+ <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
+ <DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
+ <DCC_E>false</DCC_E>
+ <DCC_N>false</DCC_N>
+ <DCC_S>false</DCC_S>
+ <DCC_F>false</DCC_F>
+ <DCC_K>false</DCC_K>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win64)'!=''">
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+ <DCC_Optimize>false</DCC_Optimize>
+ <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+ <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
+ <DCC_RemoteDebug>true</DCC_RemoteDebug>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+ <VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <DCC_RemoteDebug>false</DCC_RemoteDebug>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+ <DCC_DebugInformation>false</DCC_DebugInformation>
+ </PropertyGroup>
+ <ItemGroup>
+ <DelphiCompile Include="$(MainSource)">
+ <MainSource>MainSource</MainSource>
+ </DelphiCompile>
+ <DCCReference Include="rtl.dcp"/>
+ <DCCReference Include="Bson.pas"/>
+ <BuildConfiguration Include="Release">
+ <Key>Cfg_2</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Base">
+ <Key>Base</Key>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Debug">
+ <Key>Cfg_1</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ </ItemGroup>
+ <ProjectExtensions>
+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+ <Borland.ProjectType>Package</Borland.ProjectType>
+ <BorlandProject>
+ <Delphi.Personality>
+ <Source>
+ <Source Name="MainSource">MongoDelphiDriver.dpk</Source>
+ </Source>
+ <VersionInfo>
+ <VersionInfo Name="IncludeVerInfo">True</VersionInfo>
+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+ <VersionInfo Name="MajorVer">1</VersionInfo>
+ <VersionInfo Name="MinorVer">0</VersionInfo>
+ <VersionInfo Name="Release">0</VersionInfo>
+ <VersionInfo Name="Build">0</VersionInfo>
+ <VersionInfo Name="Debug">False</VersionInfo>
+ <VersionInfo Name="PreRelease">False</VersionInfo>
+ <VersionInfo Name="Special">False</VersionInfo>
+ <VersionInfo Name="Private">False</VersionInfo>
+ <VersionInfo Name="DLL">False</VersionInfo>
+ <VersionInfo Name="Locale">1033</VersionInfo>
+ <VersionInfo Name="CodePage">1252</VersionInfo>
+ </VersionInfo>
+ <VersionInfoKeys>
+ <VersionInfoKeys Name="CompanyName"/>
+ <VersionInfoKeys Name="FileDescription"/>
+ <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="InternalName"/>
+ <VersionInfoKeys Name="LegalCopyright"/>
+ <VersionInfoKeys Name="LegalTrademarks"/>
+ <VersionInfoKeys Name="OriginalFilename"/>
+ <VersionInfoKeys Name="ProductName"/>
+ <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="Comments"/>
+ </VersionInfoKeys>
+ <Excluded_Packages>
+ <Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
+ <Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
+ </Excluded_Packages>
+ </Delphi.Personality>
+ <Deployment/>
+ <Platforms>
+ <Platform value="Win64">True</Platform>
+ <Platform value="OSX32">False</Platform>
+ <Platform value="Win32">True</Platform>
+ </Platforms>
+ </BorlandProject>
+ <ProjectFileVersion>12</ProjectFileVersion>
+ </ProjectExtensions>
+ <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+ <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+ </Project>
48 MongoDelphiDriver.groupproj
@@ -0,0 +1,48 @@
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{A85C4061-9C73-443B-9DD9-773DB55C4F7E}</ProjectGuid>
+ </PropertyGroup>
+ <ItemGroup>
+ <Projects Include="MongoDelphiDriver.dproj">
+ <Dependencies/>
+ </Projects>
+ <Projects Include="Test.dproj">
+ <Dependencies>MongoDelphiDriver.dproj</Dependencies>
+ </Projects>
+ </ItemGroup>
+ <ProjectExtensions>
+ <Borland.Personality>Default.Personality.12</Borland.Personality>
+ <Borland.ProjectType/>
+ <BorlandProject>
+ <Default.Personality/>
+ </BorlandProject>
+ </ProjectExtensions>
+ <Target Name="MongoDelphiDriver">
+ <MSBuild Projects="MongoDelphiDriver.dproj"/>
+ </Target>
+ <Target Name="MongoDelphiDriver:Clean">
+ <MSBuild Projects="MongoDelphiDriver.dproj" Targets="Clean"/>
+ </Target>
+ <Target Name="MongoDelphiDriver:Make">
+ <MSBuild Projects="MongoDelphiDriver.dproj" Targets="Make"/>
+ </Target>
+ <Target Name="Test" DependsOnTargets="MongoDelphiDriver">
+ <MSBuild Projects="Test.dproj"/>
+ </Target>
+ <Target Name="Test:Clean" DependsOnTargets="MongoDelphiDriver:Clean">
+ <MSBuild Projects="Test.dproj" Targets="Clean"/>
+ </Target>
+ <Target Name="Test:Make" DependsOnTargets="MongoDelphiDriver:Make">
+ <MSBuild Projects="Test.dproj" Targets="Make"/>
+ </Target>
+ <Target Name="Build">
+ <CallTarget Targets="MongoDelphiDriver;Test"/>
+ </Target>
+ <Target Name="Clean">
+ <CallTarget Targets="MongoDelphiDriver:Clean;Test:Clean"/>
+ </Target>
+ <Target Name="Make">
+ <CallTarget Targets="MongoDelphiDriver:Make;Test:Make"/>
+ </Target>
+ <Import Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')" Project="$(BDS)\Bin\CodeGear.Group.Targets"/>
+ </Project>
BIN MongoDelphiDriver.res
Binary file not shown.
67 Test.dpr
@@ -0,0 +1,67 @@
+program Test;
+
+{$APPTYPE CONSOLE}
+
+{$R *.res}
+
+uses
+ System.SysUtils,
+ Bson;
+
+var
+ bb : TBsonBuffer;
+ cws : TBsonCodeWScope;
+ b : TBson;
+ i : TBsonIterator;
+ oid : TBsonOID;
+ ts : TBsonTimestamp;
+ bin : TBsonBinary;
+
+begin
+ try
+ bb := TBsonBuffer.Create();
+ bb.append('test', 'testing');
+ cws := TBsonCodeWScope.Create('Code for scope', bb.finish());
+
+ bb := TBsonBuffer.Create();
+ bb.append('name', 'Gerald');
+ bb.append('age', 35);
+ bb.append('long', Int64(89));
+ bb.append('bool', True);
+ bb.append('date', StrToDate('1/3/1970'));
+ bb.startObject('object');
+ bb.append('sub1', 'sub1');
+ bb.append('sub2', False);
+ bb.finishObject();
+ oid := TBsonOID.Create();
+ writeln(oid.AsString());
+ bb.append('oid1', oid);
+ bb.append('oid2', TBsonOID.Create('4eb6a93dad14000000000099'));
+ bb.appendCode('code', '{ this = is + code; }');
+ bb.appendSymbol('symbol', 'symbol');
+ bb.append('cws', cws);
+ bb.append('regex', TBsonRegex.Create('pattern', 'options'));
+ ts := TBsonTimestamp.Create(now, 21);
+ bb.append('timestamp', ts);
+ bb.appendBinary('binary', 0, @ts, sizeof(ts));
+
+ b := bb.finish;
+ Writeln(b.size());
+
+ b.display();
+
+ Writeln(b.value('long'));
+ i := b.find('oid1');
+ WriteLn(i.getOID().AsString());
+
+ i := b.find('binary');
+ bin := i.getBinary();
+
+ WriteLn(bin.len);
+
+ { TODO -oUser -cConsole Main : Insert code here }
+ except
+ on E: Exception do
+ Writeln(E.ClassName, ': ', E.Message);
+ end;
+end.
144 Test.dproj
@@ -0,0 +1,144 @@
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{FAAEB811-D3CA-4036-A456-D65CA8564F65}</ProjectGuid>
+ <ProjectVersion>13.4</ProjectVersion>
+ <FrameworkType>None</FrameworkType>
+ <MainSource>Test.dpr</MainSource>
+ <Base>True</Base>
+ <Config Condition="'$(Config)'==''">Debug</Config>
+ <Platform Condition="'$(Platform)'==''">Win32</Platform>
+ <TargetedPlatforms>3</TargetedPlatforms>
+ <AppType>Console</AppType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
+ <Base_Win64>true</Base_Win64>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
+ <Base_Win32>true</Base_Win32>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
+ <Cfg_1>true</Cfg_1>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
+ <Cfg_1_Win32>true</Cfg_1_Win32>
+ <CfgParent>Cfg_1</CfgParent>
+ <Cfg_1>true</Cfg_1>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
+ <Cfg_2>true</Cfg_2>
+ <CfgParent>Base</CfgParent>
+ <Base>true</Base>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base)'!=''">
+ <DCC_UsePackage>bindcompfmx;fmx;rtl;dbrtl;IndySystem;DbxClientDriver;bindcomp;inetdb;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;xmlrtl;ibxpress;DbxCommonDriver;IndyProtocols;DBXMySQLDriver;dbxcds;bindengine;FMXTee;soaprtl;DBXOracleDriver;dsnap;DBXInformixDriver;IndyCore;fmxase;CloudService;FmxTeeUI;DBXFirebirdDriver;inet;fmxobj;inetdbxpress;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IPIndyImpl;$(DCC_UsePackage)</DCC_UsePackage>
+ <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
+ <DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
+ <DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
+ <DCC_E>false</DCC_E>
+ <DCC_N>false</DCC_N>
+ <DCC_S>false</DCC_S>
+ <DCC_F>false</DCC_F>
+ <DCC_K>false</DCC_K>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win64)'!=''">
+ <DCC_UsePackage>TeeDB;vclib;Tee;DBXOdbcDriver;DBXSybaseASEDriver;vclimg;TeeUI;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;DBXDb2Driver;websnap;vclribbon;VclSmp;vcl;DataSnapConnectors;DBXMSSQLDriver;dsnapcon;vclx;webdsnap;adortl;$(DCC_UsePackage)</DCC_UsePackage>
+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Base_Win32)'!=''">
+ <DCC_UsePackage>vcldbx;frx16;TeeDB;Rave100VCL;vclib;Tee;inetdbbde;DBXOdbcDriver;svnui;DBXSybaseASEDriver;vclimg;frxDB16;intrawebdb_120_160;fmi;fs16;TeeUI;vclactnband;vcldb;vcldsnap;bindcompvcl;vclie;vcltouch;Intraweb_120_160;DBXDb2Driver;websnap;vclribbon;frxe16;VclSmp;fsDB16;vcl;DataSnapConnectors;DBXMSSQLDriver;CodeSiteExpressPkg;dsnapcon;vclx;webdsnap;svn;bdertl;adortl;$(DCC_UsePackage)</DCC_UsePackage>
+ <DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
+ <VerInfo_Locale>1033</VerInfo_Locale>
+ <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1)'!=''">
+ <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
+ <DCC_Optimize>false</DCC_Optimize>
+ <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
+ <DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
+ <DCC_RemoteDebug>true</DCC_RemoteDebug>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
+ <DCC_RemoteDebug>false</DCC_RemoteDebug>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Cfg_2)'!=''">
+ <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
+ <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
+ <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
+ <DCC_DebugInformation>false</DCC_DebugInformation>
+ </PropertyGroup>
+ <ItemGroup>
+ <DelphiCompile Include="$(MainSource)">
+ <MainSource>MainSource</MainSource>
+ </DelphiCompile>
+ <BuildConfiguration Include="Release">
+ <Key>Cfg_2</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Base">
+ <Key>Base</Key>
+ </BuildConfiguration>
+ <BuildConfiguration Include="Debug">
+ <Key>Cfg_1</Key>
+ <CfgParent>Base</CfgParent>
+ </BuildConfiguration>
+ </ItemGroup>
+ <ProjectExtensions>
+ <Borland.Personality>Delphi.Personality.12</Borland.Personality>
+ <Borland.ProjectType/>
+ <BorlandProject>
+ <Delphi.Personality>
+ <VersionInfo>
+ <VersionInfo Name="IncludeVerInfo">False</VersionInfo>
+ <VersionInfo Name="AutoIncBuild">False</VersionInfo>
+ <VersionInfo Name="MajorVer">1</VersionInfo>
+ <VersionInfo Name="MinorVer">0</VersionInfo>
+ <VersionInfo Name="Release">0</VersionInfo>
+ <VersionInfo Name="Build">0</VersionInfo>
+ <VersionInfo Name="Debug">False</VersionInfo>
+ <VersionInfo Name="PreRelease">False</VersionInfo>
+ <VersionInfo Name="Special">False</VersionInfo>
+ <VersionInfo Name="Private">False</VersionInfo>
+ <VersionInfo Name="DLL">False</VersionInfo>
+ <VersionInfo Name="Locale">1033</VersionInfo>
+ <VersionInfo Name="CodePage">1252</VersionInfo>
+ </VersionInfo>
+ <VersionInfoKeys>
+ <VersionInfoKeys Name="CompanyName"/>
+ <VersionInfoKeys Name="FileDescription"/>
+ <VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="InternalName"/>
+ <VersionInfoKeys Name="LegalCopyright"/>
+ <VersionInfoKeys Name="LegalTrademarks"/>
+ <VersionInfoKeys Name="OriginalFilename"/>
+ <VersionInfoKeys Name="ProductName"/>
+ <VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
+ <VersionInfoKeys Name="Comments"/>
+ </VersionInfoKeys>
+ <Source>
+ <Source Name="MainSource">Test.dpr</Source>
+ </Source>
+ </Delphi.Personality>
+ <Deployment/>
+ <Platforms>
+ <Platform value="Win64">True</Platform>
+ <Platform value="OSX32">False</Platform>
+ <Platform value="Win32">True</Platform>
+ </Platforms>
+ </BorlandProject>
+ <ProjectFileVersion>12</ProjectFileVersion>
+ </ProjectExtensions>
+ <Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
+ <Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
+ </Project>
BIN Test.res
Binary file not shown.

0 comments on commit 9fd3f00

Please sign in to comment.
Something went wrong with that request. Please try again.