/ Celestin Apprentice 7
/ Apprentice-Release7.iso / Demos / A.D. Software / OOFILE 1.3b4d6.sit / OOFILE 1.3b4d6 / MacCodeWarriorDemo1.3b4d6 / docs / samples / ooftst15.cpp ![]() | < prev | next > |
MacBinary | 1997-03-18 | 2.5 KB | [TEXT/CWIE] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
10% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
1% | dexvert | Text File (text/txt) | fallback | Supported |
100% | file | MacBinary II, Mon Mar 17 20:06:37 1997, modified Mon Mar 17 20:06:37 1997, creator 'CWIE', type ASCII, 1901 bytes "ooftst15.cpp" , at 0x7ed 410 bytes resource | default (weak) | |
99% | file | data | default | |
74% | TrID | Macintosh plain text (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | siegfried | fmt/1762 MacBinary (II) | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [TEXT] |
macFileCreator | [CWIE] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 6f 6f 66 74 73 74 | 31 35 2e 63 70 70 00 00 |..ooftst|15.cpp..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 00 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 07 6d 00 | 00 01 9a af 53 9b 1d af |......m.|....S...|
|00000060| 53 9b 1d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |S.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 79 2d 00 00 |........|....y-..|
|00000080| 2f 2f 20 43 6f 70 79 72 | 69 67 68 74 20 31 39 39 |// Copyr|ight 199|
|00000090| 35 20 41 2e 44 2e 20 53 | 6f 66 74 77 61 72 65 2e |5 A.D. S|oftware.|
|000000a0| 20 41 6c 6c 20 52 69 67 | 68 74 73 20 52 65 73 65 | All Rig|hts Rese|
|000000b0| 72 76 65 64 0d 0d 2f 2f | 20 4f 4f 46 54 53 54 31 |rved..//| OOFTST1|
|000000c0| 35 0d 0d 2f 2f 20 64 65 | 6d 6f 6e 73 74 72 61 74 |5..// de|monstrat|
|000000d0| 65 73 20 6f 70 65 6e 69 | 6e 67 20 74 77 6f 20 64 |es openi|ng two d|
|000000e0| 61 74 61 62 61 73 65 73 | 20 73 65 71 75 65 6e 74 |atabases| sequent|
|000000f0| 69 61 6c 6c 79 0d 0d 2f | 2f 20 53 69 6d 70 6c 65 |ially../|/ Simple|
|00000100| 20 73 74 72 65 61 6d 20 | 49 2f 4f 20 69 73 20 75 | stream |I/O is u|
|00000110| 73 65 64 20 74 6f 20 69 | 6e 74 65 72 61 63 74 20 |sed to i|nteract |
|00000120| 77 69 74 68 20 74 68 65 | 20 75 73 65 72 2e 0d 23 |with the| user..#|
|00000130| 69 6e 63 6c 75 64 65 20 | 22 6f 6f 66 69 6c 65 2e |include |"oofile.|
|00000140| 68 22 0d 0d 23 69 6e 63 | 6c 75 64 65 20 22 6f 6f |h"..#inc|lude "oo|
|00000150| 66 74 73 74 30 31 2e 68 | 22 0d 23 69 6e 63 6c 75 |ftst01.h|".#inclu|
|00000160| 64 65 20 22 6f 6f 66 74 | 73 74 30 32 2e 68 22 0d |de "ooft|st02.h".|
|00000170| 0d 2f 2f 20 67 6c 6f 62 | 61 6c 20 76 61 72 69 61 |.// glob|al varia|
|00000180| 62 6c 65 73 20 74 68 61 | 74 20 64 65 66 69 6e 65 |bles tha|t define|
|00000190| 20 74 68 65 20 64 61 74 | 61 62 61 73 65 20 75 73 | the dat|abase us|
|000001a0| 69 6e 67 20 74 68 65 20 | 6f 6f 66 74 73 74 30 32 |ing the |ooftst02|
|000001b0| 20 63 6c 61 73 73 65 73 | 0d 0d 09 54 45 53 54 5f | classes|...TEST_|
|000001c0| 43 4f 4e 4e 45 43 54 20 | 20 20 20 74 68 65 44 42 |CONNECT | theDB|
|000001d0| 3b 0d 09 64 62 50 61 74 | 69 65 6e 74 73 20 20 20 |;..dbPat|ients |
|000001e0| 20 20 50 61 74 69 65 6e | 74 73 3b 0d 09 64 62 56 | Patien|ts;..dbV|
|000001f0| 69 73 69 74 73 09 56 69 | 73 69 74 73 3b 0d 09 64 |isits.Vi|sits;..d|
|00000200| 62 52 65 6c 61 74 69 6f | 6e 73 68 69 70 20 50 61 |bRelatio|nship Pa|
|00000210| 74 69 65 6e 74 56 69 73 | 69 74 73 28 50 61 74 69 |tientVis|its(Pati|
|00000220| 65 6e 74 73 2e 56 69 73 | 69 74 73 2c 20 56 69 73 |ents.Vis|its, Vis|
|00000230| 69 74 73 2e 50 61 74 69 | 65 6e 74 29 3b 0d 09 0d |its.Pati|ent);...|
|00000240| 0d 69 6e 74 20 6d 61 69 | 6e 28 29 0d 7b 0d 09 63 |.int mai|n().{..c|
|00000250| 6f 75 74 20 3c 3c 20 22 | 4f 4f 46 49 4c 45 20 56 |out << "|OOFILE V|
|00000260| 61 6c 69 64 61 74 69 6f | 6e 20 53 75 69 74 65 20 |alidatio|n Suite |
|00000270| 2d 20 54 65 73 74 20 31 | 35 5c 6e 22 0d 09 09 20 |- Test 1|5\n"... |
|00000280| 3c 3c 20 22 53 69 6d 70 | 6c 65 20 74 65 73 74 20 |<< "Simp|le test |
|00000290| 74 6f 20 64 65 6d 6f 6e | 73 74 72 61 74 65 20 6f |to demon|strate o|
|000002a0| 70 65 6e 69 6e 67 20 74 | 77 6f 20 64 61 74 61 62 |pening t|wo datab|
|000002b0| 61 73 65 73 22 20 3c 3c | 20 65 6e 64 6c 0d 09 09 |ases" <<| endl...|
|000002c0| 20 3c 3c 20 22 61 74 20 | 64 69 66 66 65 72 65 6e | << "at |differen|
|000002d0| 74 20 74 69 6d 65 73 22 | 20 3c 3c 20 65 6e 64 6c |t times"| << endl|
|000002e0| 3b 0d 0d 09 23 69 66 64 | 65 66 20 54 45 53 54 49 |;...#ifd|ef TESTI|
|000002f0| 4e 47 5f 44 42 41 53 45 | 0d 09 09 23 69 66 64 65 |NG_DBASE|...#ifde|
|00000300| 66 20 5f 4d 61 63 69 6e | 74 6f 73 68 0d 09 09 09 |f _Macin|tosh....|
|00000310| 63 6f 6e 73 74 20 63 68 | 61 72 2a 20 6b 45 78 69 |const ch|ar* kExi|
|00000320| 73 74 73 4e 61 6d 65 20 | 3d 20 20 22 3a 6f 6f 66 |stsName |= ":oof|
|00000330| 74 73 74 31 35 3a 50 61 | 74 69 65 6e 74 73 2e 64 |tst15:Pa|tients.d|
|00000340| 62 66 22 3b 0d 09 09 09 | 63 6f 6e 73 74 20 63 68 |bf";....|const ch|
|00000350| 61 72 2a 20 6b 44 61 74 | 61 62 61 73 65 4e 61 6d |ar* kDat|abaseNam|
|00000360| 65 20 3d 20 22 3a 6f 6f | 66 74 73 74 31 35 3a 22 |e = ":oo|ftst15:"|
|00000370| 3b 0d 09 09 23 65 6c 73 | 65 0d 09 09 09 63 6f 6e |;...#els|e....con|
|00000380| 73 74 20 63 68 61 72 2a | 20 6b 45 78 69 73 74 73 |st char*| kExists|
|00000390| 4e 61 6d 65 20 3d 20 20 | 20 22 50 65 6f 70 6c 65 |Name = | "People|
|000003a0| 2e 64 62 66 22 0d 09 09 | 09 63 6f 6e 73 74 20 63 |.dbf"...|.const c|
|000003b0| 68 61 72 2a 20 6b 44 61 | 74 61 62 61 73 65 4e 61 |har* kDa|tabaseNa|
|000003c0| 6d 65 20 3d 20 22 22 3b | 0d 09 09 23 65 6e 64 69 |me = "";|...#endi|
|000003d0| 66 09 0d 0d 09 23 65 6c | 73 65 0d 09 09 63 6f 6e |f....#el|se...con|
|000003e0| 73 74 20 63 68 61 72 2a | 20 6b 44 61 74 61 62 61 |st char*| kDataba|
|000003f0| 73 65 4e 61 6d 65 20 3d | 20 22 6f 6f 66 74 73 74 |seName =| "ooftst|
|00000400| 31 35 2e 64 62 22 3b 0d | 09 09 63 6f 6e 73 74 20 |15.db";.|..const |
|00000410| 63 68 61 72 2a 20 6b 45 | 78 69 73 74 73 4e 61 6d |char* kE|xistsNam|
|00000420| 65 20 3d 20 6b 44 61 74 | 61 62 61 73 65 4e 61 6d |e = kDat|abaseNam|
|00000430| 65 3b 0d 09 23 65 6e 64 | 69 66 0d 0d 09 69 66 20 |e;..#end|if...if |
|00000440| 28 64 62 43 6f 6e 6e 65 | 63 74 3a 3a 66 69 6c 65 |(dbConne|ct::file|
|00000450| 45 78 69 73 74 73 28 6b | 45 78 69 73 74 73 4e 61 |Exists(k|ExistsNa|
|00000460| 6d 65 29 29 20 7b 0d 09 | 09 74 68 65 44 42 2e 6f |me)) {..|.theDB.o|
|00000470| 70 65 6e 43 6f 6e 6e 65 | 63 74 69 6f 6e 28 6b 44 |penConne|ction(kD|
|00000480| 61 74 61 62 61 73 65 4e | 61 6d 65 29 3b 0d 09 7d |atabaseN|ame);..}|
|00000490| 0d 09 65 6c 73 65 20 7b | 0d 09 09 74 68 65 44 42 |..else {|...theDB|
|000004a0| 2e 6e 65 77 43 6f 6e 6e | 65 63 74 69 6f 6e 28 6b |.newConn|ection(k|
|000004b0| 44 61 74 61 62 61 73 65 | 4e 61 6d 65 29 3b 0d 09 |Database|Name);..|
|000004c0| 09 50 61 74 69 65 6e 74 | 73 2e 41 64 64 54 65 73 |.Patient|s.AddTes|
|000004d0| 74 44 61 74 61 28 29 3b | 0d 09 7d 0d 09 0d 09 63 |tData();|..}....c|
|000004e0| 6f 75 74 20 3c 3c 20 22 | 44 75 6d 70 69 6e 67 20 |out << "|Dumping |
|000004f0| 74 68 65 20 66 69 72 73 | 74 20 64 61 74 61 62 61 |the firs|t databa|
|00000500| 73 65 2c 20 50 61 74 69 | 65 6e 74 73 20 26 20 56 |se, Pati|ents & V|
|00000510| 69 73 69 74 73 22 20 3c | 3c 20 65 6e 64 6c 20 3c |isits" <|< endl <|
|00000520| 3c 20 65 6e 64 6c 20 0d | 09 09 20 3c 3c 20 74 68 |< endl .|.. << th|
|00000530| 65 44 42 0d 09 09 20 3c | 3c 20 65 6e 64 6c 20 3c |eDB... <|< endl <|
|00000540| 3c 20 65 6e 64 6c 3b 0d | 09 0d 09 74 68 65 44 42 |< endl;.|...theDB|
|00000550| 2e 63 6c 6f 73 65 28 29 | 3b 0d 09 0d 09 0d 2f 2f |.close()|;.....//|
|00000560| 20 6e 6f 77 20 63 72 65 | 61 74 65 20 74 68 65 20 | now cre|ate the |
|00000570| 73 65 63 6f 6e 64 20 64 | 61 74 61 62 61 73 65 0d |second d|atabase.|
|00000580| 09 54 45 53 54 5f 43 4f | 4e 4e 45 43 54 20 20 20 |.TEST_CO|NNECT |
|00000590| 20 74 68 65 44 42 32 3b | 0d 09 64 62 50 65 6f 70 | theDB2;|..dbPeop|
|000005a0| 6c 65 20 20 20 20 20 50 | 65 6f 70 6c 65 3b 0d 0d |le P|eople;..|
|000005b0| 09 23 69 66 64 65 66 20 | 54 45 53 54 49 4e 47 5f |.#ifdef |TESTING_|
|000005c0| 44 42 41 53 45 0d 09 09 | 23 69 66 64 65 66 20 5f |DBASE...|#ifdef _|
|000005d0| 4d 61 63 69 6e 74 6f 73 | 68 0d 09 09 09 6b 45 78 |Macintos|h....kEx|
|000005e0| 69 73 74 73 4e 61 6d 65 | 20 3d 20 20 22 3a 6f 6f |istsName| = ":oo|
|000005f0| 66 74 73 78 31 35 3a 50 | 61 74 69 65 6e 74 73 2e |ftsx15:P|atients.|
|00000600| 64 62 66 22 3b 0d 09 09 | 09 6b 44 61 74 61 62 61 |dbf";...|.kDataba|
|00000610| 73 65 4e 61 6d 65 20 3d | 20 22 3a 6f 6f 66 74 73 |seName =| ":oofts|
|00000620| 78 31 35 3a 22 3b 0d 09 | 09 23 65 6c 73 65 0d 09 |x15:";..|.#else..|
|00000630| 09 09 6b 45 78 69 73 74 | 73 4e 61 6d 65 20 3d 20 |..kExist|sName = |
|00000640| 20 20 22 50 61 74 69 65 | 6e 74 73 2e 64 62 66 22 | "Patie|nts.dbf"|
|00000650| 0d 09 09 09 6b 44 61 74 | 61 62 61 73 65 4e 61 6d |....kDat|abaseNam|
|00000660| 65 20 3d 20 22 22 3b 0d | 09 09 23 65 6e 64 69 66 |e = "";.|..#endif|
|00000670| 09 0d 0d 09 23 65 6c 73 | 65 0d 09 09 6b 44 61 74 |....#els|e...kDat|
|00000680| 61 62 61 73 65 4e 61 6d | 65 20 3d 20 22 6f 6f 66 |abaseNam|e = "oof|
|00000690| 74 73 78 31 35 2e 64 62 | 22 3b 0d 09 09 6b 45 78 |tsx15.db|";...kEx|
|000006a0| 69 73 74 73 4e 61 6d 65 | 20 3d 20 6b 44 61 74 61 |istsName| = kData|
|000006b0| 62 61 73 65 4e 61 6d 65 | 3b 0d 09 23 65 6e 64 69 |baseName|;..#endi|
|000006c0| 66 0d 09 0d 09 69 66 20 | 28 64 62 43 6f 6e 6e 65 |f....if |(dbConne|
|000006d0| 63 74 3a 3a 66 69 6c 65 | 45 78 69 73 74 73 28 6b |ct::file|Exists(k|
|000006e0| 45 78 69 73 74 73 4e 61 | 6d 65 29 29 20 7b 0d 09 |ExistsNa|me)) {..|
|000006f0| 09 74 68 65 44 42 32 2e | 6f 70 65 6e 43 6f 6e 6e |.theDB2.|openConn|
|00000700| 65 63 74 69 6f 6e 28 6b | 44 61 74 61 62 61 73 65 |ection(k|Database|
|00000710| 4e 61 6d 65 29 3b 0d 09 | 7d 0d 09 65 6c 73 65 20 |Name);..|}..else |
|00000720| 7b 0d 09 09 74 68 65 44 | 42 32 2e 6e 65 77 43 6f |{...theD|B2.newCo|
|00000730| 6e 6e 65 63 74 69 6f 6e | 28 6b 44 61 74 61 62 61 |nnection|(kDataba|
|00000740| 73 65 4e 61 6d 65 29 3b | 0d 09 09 50 65 6f 70 6c |seName);|...Peopl|
|00000750| 65 2e 41 64 64 54 65 73 | 74 44 61 74 61 28 29 3b |e.AddTes|tData();|
|00000760| 0d 09 7d 0d 09 09 0d 09 | 63 6f 75 74 20 3c 3c 20 |..}.....|cout << |
|00000770| 22 44 75 6d 70 69 6e 67 | 20 74 68 65 20 73 65 63 |"Dumping| the sec|
|00000780| 6f 6e 64 20 64 61 74 61 | 62 61 73 65 2c 20 50 65 |ond data|base, Pe|
|00000790| 6f 70 6c 65 22 20 3c 3c | 20 65 6e 64 6c 20 3c 3c |ople" <<| endl <<|
|000007a0| 20 65 6e 64 6c 20 3c 3c | 20 74 68 65 44 42 32 3b | endl <<| theDB2;|
|000007b0| 0d 09 0d 09 63 6f 75 74 | 20 3c 3c 20 22 44 6f 6e |....cout| << "Don|
|000007c0| 65 22 20 3c 3c 20 65 6e | 64 6c 3b 0d 09 0d 09 72 |e" << en|dl;....r|
|000007d0| 65 74 75 72 6e 20 45 58 | 49 54 5f 53 55 43 43 45 |eturn EX|IT_SUCCE|
|000007e0| 53 53 3b 0d 7d 20 20 20 | 20 20 20 20 0d 00 00 00 |SS;.} | ....|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000810| 00 00 16 5b 00 00 00 00 | 00 00 00 00 00 00 00 00 |...[....|........|
|00000820| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000830| 0c 6f 6f 66 74 73 74 31 | 35 2e 63 70 70 31 02 00 |.ooftst1|5.cpp1..|
|00000840| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000850| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 b0 1b 75 f9 00 00 | 00 00 00 00 01 9a 00 00 |....u...|........|
|00000880| 00 00 00 00 00 00 00 00 | 00 00 01 78 25 00 00 00 |........|...x%...|
|00000890| 16 e8 14 43 61 70 69 74 | 61 6c 69 7a 65 20 53 65 |...Capit|alize Se|
|000008a0| 6e 74 65 6e 63 65 73 00 | 00 00 00 00 00 00 00 00 |ntences.|........|
|000008b0| 00 00 00 00 01 4c 25 00 | 00 00 17 76 07 41 47 61 |.....L%.|...v.AGa|
|000008c0| 72 52 65 67 00 00 00 00 | 00 00 00 00 00 00 00 00 |rReg....|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 01 99 |........|........|
|000008e0| 25 00 00 00 17 76 10 46 | 69 6e 64 65 72 46 6f 6e |%....v.F|inderFon|
|000008f0| 74 20 32 2e 31 2e 31 00 | 00 00 00 00 00 00 00 00 |t 2.1.1.|........|
|00000900| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 0a 01 d3 |........|...W....|
|00000930| 02 62 00 57 00 0a 01 d3 | 02 62 af 68 7a 87 00 00 |.b.W....|.b.hz...|
|00000940| 00 00 00 00 00 00 00 00 | 00 36 01 00 00 00 00 04 |........|.6......|
|00000950| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|00000960| 00 00 00 46 01 a3 eb 60 | 2a f8 00 00 00 1c 00 46 |...F...`|*......F|
|00000970| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00000980| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00000990| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+