/ Celestin Apprentice 7
/ Apprentice-Release7.iso / Demos / A.D. Software / OOFILE 1.3b4d6.sit / OOFILE 1.3b4d6 / MacCodeWarriorDemo1.3b4d6 / docs / samples / ooftst34.cpp ![]() | < prev | next > |
MacBinary | 1997-04-02 | 2.0 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, Wed Apr 2 14:51:29 1997, modified Wed Apr 2 14:51:29 1997, creator 'CWIE', type ASCII, 1360 bytes "ooftst34.cpp" , at 0x5d0 442 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 | 33 34 2e 63 70 70 00 00 |..ooftst|34.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 05 50 00 | 00 01 ba af 68 69 41 af |......P.|....hiA.|
|00000060| 68 69 41 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |hiA.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 34 68 00 00 |........|....4h..|
|00000080| 2f 2f 20 43 6f 70 79 72 | 69 67 68 74 20 31 39 39 |// Copyr|ight 199|
|00000090| 34 20 41 2e 44 2e 20 53 | 6f 66 74 77 61 72 65 2e |4 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 45 53 54 |rved..//| OOFTEST|
|000000c0| 33 34 0d 0d 2f 2f 20 54 | 68 69 73 20 73 61 6d 70 |34..// T|his samp|
|000000d0| 6c 65 20 74 65 73 74 73 | 20 74 68 65 20 50 65 72 |le tests| the Per|
|000000e0| 73 69 73 74 65 6e 74 20 | 52 41 4d 20 64 61 74 61 |sistent |RAM data|
|000000f0| 62 61 73 65 20 62 61 63 | 6b 65 6e 64 20 0d 2f 2f |base bac|kend .//|
|00000100| 20 61 62 69 6c 69 74 79 | 20 74 6f 20 73 61 76 65 | ability| to save|
|00000110| 20 61 6e 64 20 72 65 76 | 65 72 74 20 74 68 65 20 | and rev|ert the |
|00000120| 77 68 6f 6c 65 20 64 61 | 74 61 62 61 73 65 2e 0d |whole da|tabase..|
|00000130| 0d 2f 2f 20 53 69 6d 70 | 6c 65 20 73 74 72 65 61 |.// Simp|le strea|
|00000140| 6d 20 49 2f 4f 20 69 73 | 20 75 73 65 64 20 74 6f |m I/O is| used to|
|00000150| 20 69 6e 74 65 72 61 63 | 74 20 77 69 74 68 20 74 | interac|t with t|
|00000160| 68 65 20 75 73 65 72 2e | 0d 23 69 6e 63 6c 75 64 |he user.|.#includ|
|00000170| 65 20 22 6f 6f 66 69 6c | 65 2e 68 22 0d 0d 23 69 |e "oofil|e.h"..#i|
|00000180| 6e 63 6c 75 64 65 20 22 | 6f 6f 66 74 73 74 30 32 |nclude "|ooftst02|
|00000190| 2e 68 22 0d 0d 2f 2f 20 | 67 6c 6f 62 61 6c 20 76 |.h"..// |global v|
|000001a0| 61 72 69 61 62 6c 65 73 | 20 74 68 61 74 20 64 65 |ariables| that de|
|000001b0| 66 69 6e 65 20 74 68 65 | 20 64 61 74 61 62 61 73 |fine the| databas|
|000001c0| 65 20 75 73 69 6e 67 20 | 74 68 65 20 6f 6f 66 74 |e using |the ooft|
|000001d0| 73 74 30 32 20 63 6c 61 | 73 73 65 73 0d 0d 09 64 |st02 cla|sses...d|
|000001e0| 62 43 6f 6e 6e 65 63 74 | 5f 72 61 6d 70 20 20 20 |bConnect|_ramp |
|000001f0| 20 74 68 65 44 42 3b 0d | 09 64 62 50 61 74 69 65 | theDB;.|.dbPatie|
|00000200| 6e 74 73 20 20 20 20 20 | 50 61 74 69 65 6e 74 73 |nts |Patients|
|00000210| 3b 0d 09 64 62 56 69 73 | 69 74 73 09 56 69 73 69 |;..dbVis|its.Visi|
|00000220| 74 73 3b 0d 09 64 62 52 | 65 6c 61 74 69 6f 6e 73 |ts;..dbR|elations|
|00000230| 68 69 70 20 50 61 74 69 | 65 6e 74 56 69 73 69 74 |hip Pati|entVisit|
|00000240| 73 28 50 61 74 69 65 6e | 74 73 2e 56 69 73 69 74 |s(Patien|ts.Visit|
|00000250| 73 2c 20 56 69 73 69 74 | 73 2e 50 61 74 69 65 6e |s, Visit|s.Patien|
|00000260| 74 29 3b 0d 09 0d 69 6e | 74 20 6d 61 69 6e 28 29 |t);...in|t main()|
|00000270| 0d 7b 0d 09 63 6f 75 74 | 20 3c 3c 20 22 4f 4f 46 |.{..cout| << "OOF|
|00000280| 49 4c 45 20 56 61 6c 69 | 64 61 74 69 6f 6e 20 53 |ILE Vali|dation S|
|00000290| 75 69 74 65 20 2d 20 54 | 65 73 74 20 33 34 5c 6e |uite - T|est 34\n|
|000002a0| 22 0d 09 09 20 3c 3c 20 | 22 53 69 6d 70 6c 65 20 |"... << |"Simple |
|000002b0| 74 65 73 74 20 6f 66 20 | 50 65 72 73 69 73 74 65 |test of |Persiste|
|000002c0| 6e 74 20 52 41 4d 20 28 | 72 61 6d 70 29 20 62 61 |nt RAM (|ramp) ba|
|000002d0| 63 6b 65 6e 64 22 20 3c | 3c 20 65 6e 64 6c 0d 09 |ckend" <|< endl..|
|000002e0| 09 20 3c 3c 20 22 73 61 | 76 65 20 61 6e 64 20 72 |. << "sa|ve and r|
|000002f0| 65 76 65 72 74 20 66 61 | 63 69 6c 69 74 79 22 20 |evert fa|cility" |
|00000300| 3c 3c 20 65 6e 64 6c 20 | 3c 3c 20 65 6e 64 6c 3b |<< endl |<< endl;|
|00000310| 0d 0d 09 63 6f 6e 73 74 | 20 63 68 61 72 2a 20 6b |...const| char* k|
|00000320| 44 61 74 61 62 61 73 65 | 4e 61 6d 65 20 3d 20 22 |Database|Name = "|
|00000330| 6f 6f 66 74 73 74 33 34 | 2e 64 62 22 3b 0d 09 63 |ooftst34|.db";..c|
|00000340| 6f 6e 73 74 20 63 68 61 | 72 2a 20 6b 45 78 69 73 |onst cha|r* kExis|
|00000350| 74 73 4e 61 6d 65 20 3d | 20 6b 44 61 74 61 62 61 |tsName =| kDataba|
|00000360| 73 65 4e 61 6d 65 3b 0d | 09 0d 09 69 66 20 28 64 |seName;.|...if (d|
|00000370| 62 43 6f 6e 6e 65 63 74 | 3a 3a 66 69 6c 65 45 78 |bConnect|::fileEx|
|00000380| 69 73 74 73 28 6b 45 78 | 69 73 74 73 4e 61 6d 65 |ists(kEx|istsName|
|00000390| 29 29 20 7b 0d 09 09 74 | 68 65 44 42 2e 6f 70 65 |)) {...t|heDB.ope|
|000003a0| 6e 43 6f 6e 6e 65 63 74 | 69 6f 6e 28 6b 44 61 74 |nConnect|ion(kDat|
|000003b0| 61 62 61 73 65 4e 61 6d | 65 29 3b 0d 09 7d 0d 09 |abaseNam|e);..}..|
|000003c0| 65 6c 73 65 20 7b 0d 09 | 09 74 68 65 44 42 2e 6e |else {..|.theDB.n|
|000003d0| 65 77 43 6f 6e 6e 65 63 | 74 69 6f 6e 28 6b 44 61 |ewConnec|tion(kDa|
|000003e0| 74 61 62 61 73 65 4e 61 | 6d 65 29 3b 0d 09 09 50 |tabaseNa|me);...P|
|000003f0| 61 74 69 65 6e 74 73 2e | 41 64 64 54 65 73 74 44 |atients.|AddTestD|
|00000400| 61 74 61 28 29 3b 0d 09 | 09 74 68 65 44 42 2e 73 |ata();..|.theDB.s|
|00000410| 61 76 65 28 29 3b 09 2f | 2f 20 73 6f 20 77 65 20 |ave();./|/ so we |
|00000420| 68 61 76 65 20 61 20 64 | 61 74 61 62 61 73 65 20 |have a d|atabase |
|00000430| 6f 6e 20 64 69 73 6b 20 | 66 72 6f 6d 20 77 68 69 |on disk |from whi|
|00000440| 63 68 20 74 6f 20 52 65 | 76 65 72 74 0d 09 7d 0d |ch to Re|vert..}.|
|00000450| 0d 09 63 6f 75 74 20 3c | 3c 20 74 68 65 44 42 3b |..cout <|< theDB;|
|00000460| 0d 0d 09 50 61 74 69 65 | 6e 74 73 2e 73 65 61 72 |...Patie|nts.sear|
|00000470| 63 68 28 50 61 74 69 65 | 6e 74 73 2e 50 61 74 69 |ch(Patie|nts.Pati|
|00000480| 65 6e 74 4e 6f 3d 3d 33 | 29 3b 0d 09 63 6f 75 74 |entNo==3|);..cout|
|00000490| 20 3c 3c 20 22 46 69 6e | 64 69 6e 67 20 50 61 74 | << "Fin|ding Pat|
|000004a0| 69 65 6e 74 20 4e 6f 20 | 33 20 3a 20 22 20 3c 3c |ient No |3 : " <<|
|000004b0| 20 50 61 74 69 65 6e 74 | 73 20 3c 3c 20 65 6e 64 | Patient|s << end|
|000004c0| 6c 3b 0d 09 0d 09 63 6f | 75 74 20 3c 3c 20 22 43 |l;....co|ut << "C|
|000004d0| 68 61 6e 67 69 6e 67 20 | 6e 61 6d 65 3a 20 22 20 |hanging |name: " |
|000004e0| 3c 3c 20 65 6e 64 6c 3b | 0d 09 50 61 74 69 65 6e |<< endl;|..Patien|
|000004f0| 74 73 2e 4c 61 73 74 4e | 61 6d 65 20 3d 20 22 57 |ts.LastN|ame = "W|
|00000500| 68 61 74 6e 6f 74 22 3b | 0d 09 50 61 74 69 65 6e |hatnot";|..Patien|
|00000510| 74 73 2e 73 61 76 65 52 | 65 63 6f 72 64 28 29 3b |ts.saveR|ecord();|
|00000520| 0d 09 63 6f 75 74 20 3c | 3c 20 50 61 74 69 65 6e |..cout <|< Patien|
|00000530| 74 73 20 3c 3c 20 65 6e | 64 6c 20 3c 3c 20 65 6e |ts << en|dl << en|
|00000540| 64 6c 3b 0d 0d 09 74 68 | 65 44 42 2e 72 65 76 65 |dl;...th|eDB.reve|
|00000550| 72 74 28 29 3b 0d 09 63 | 6f 75 74 20 3c 3c 20 22 |rt();..c|out << "|
|00000560| 41 66 74 65 72 20 72 65 | 76 65 72 74 5c 6e 22 20 |After re|vert\n" |
|00000570| 3c 3c 20 74 68 65 44 42 | 20 3c 3c 20 65 6e 64 6c |<< theDB| << endl|
|00000580| 20 3c 3c 20 65 6e 64 6c | 3b 0d 09 0d 09 63 6f 75 | << endl|;....cou|
|00000590| 74 20 3c 3c 20 22 54 65 | 73 74 20 43 6f 6d 70 6c |t << "Te|st Compl|
|000005a0| 65 74 65 64 22 20 3c 3c | 20 65 6e 64 6c 3b 0d 09 |eted" <<| endl;..|
|000005b0| 0d 09 72 65 74 75 72 6e | 20 45 58 49 54 5f 53 55 |..return| EXIT_SU|
|000005c0| 43 43 45 53 53 3b 0d 7d | 20 20 20 20 20 20 20 0d |CCESS;.}| .|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 00 00 01 00 00 00 01 68 | 00 00 00 68 00 00 00 52 |.......h|...h...R|
|00000610| 00 00 00 3d 0d 53 74 61 | 72 74 75 70 20 49 74 65 |...=.Sta|rtup Ite|
|00000620| 6d 73 01 00 00 00 00 00 | 00 00 01 88 ae b2 50 1e |ms......|......P.|
|00000630| 0c 6f 6f 66 74 73 74 33 | 34 2e 63 70 70 33 02 00 |.ooftst3|4.cpp3..|
|00000640| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000650| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 b0 1b 76 04 00 00 | 00 00 00 00 01 ba 4d 41 |....v...|......MA|
|00000680| 43 53 21 00 01 04 00 c0 | 00 00 00 00 03 f3 00 00 |CS!.....|........|
|00000690| 00 00 05 52 00 00 0c 00 | 00 00 00 5c ec 79 00 5c |...R....|...\.y.\|
|000006a0| f4 00 ad 27 db 40 ae dc | c0 6f 00 00 00 00 00 00 |...'.@..|.o......|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 0e 2e 00 01 00 00 00 00 | 00 00 00 00 06 64 00 71 |........|.....d.q|
|000006d0| 06 d6 01 3c 08 13 00 65 | 00 00 00 00 00 00 00 00 |...<...e|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 00 10 00 01 00 00 | 01 ee 00 00 01 f2 05 6d |........|.......m|
|00000710| 61 69 6e 00 00 00 00 48 | 00 09 4d 6f 6e 61 63 6f |ain....H|..Monaco|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 03 00 04 00 56 |........|.......V|
|00000740| 00 03 02 45 02 63 00 56 | 00 03 02 45 02 63 af 68 |...E.c.V|...E.c.h|
|00000750| 3e c0 00 00 02 b8 00 00 | 02 b8 00 00 00 00 01 00 |>.......|........|
|00000760| 00 00 00 04 00 01 00 01 | 00 00 01 00 00 00 01 68 |........|.......h|
|00000770| 00 00 00 68 00 00 00 52 | 01 a3 e4 cc 2d 8a 00 00 |...h...R|....-...|
|00000780| 00 1c 00 52 00 01 4d 50 | 53 52 00 01 00 12 4d 57 |...R..MP|SR....MW|
|00000790| 42 42 00 00 00 2a 03 ef | ff ff 00 00 00 00 00 00 |BB...*..|........|
|000007a0| 00 00 03 ed ff ff 00 00 | 00 14 00 00 00 00 03 f0 |........|........|
|000007b0| ff ff 00 00 00 60 00 00 | 00 00 00 00 00 00 00 00 |.....`..|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+