home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Updaters / WhiteCap 3.0.4 / WhiteCap Source.sit / WhiteCap Source / Common / math / ExpressionDict.cpp < prev    next >
MacBinary  |  1999-07-13  |  1.6 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: ExpressionDict.cpp

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Jul 13 21:53:58 1999, modified Tue Jul 13 21:53:58 1999, creator 'CWIE', type ASCII, 989 bytes "ExpressionDict.cpp" , at 0x45d 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
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 12 45 78 70 72 65 73 | 73 69 6f 6e 44 69 63 74 |..Expres|sionDict|
|00000010| 2e 63 70 70 00 00 00 00 | 00 00 00 00 00 00 00 00 |.cpp....|........|
|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 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 03 dd 00 | 00 01 9a b3 b1 9e 36 b3 |........|......6.|
|00000060| b1 9e 36 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..6.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 8b 4a 00 00 |........|.....J..|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 45 78 70 72 65 73 |#include| "Expres|
|00000090| 73 69 6f 6e 44 69 63 74 | 2e 68 22 0d 0d 23 69 6e |sionDict|.h"..#in|
|000000a0| 63 6c 75 64 65 20 22 55 | 74 69 6c 53 74 72 2e 68 |clude "U|tilStr.h|
|000000b0| 22 0d 0d 0d 45 78 70 72 | 65 73 73 69 6f 6e 44 69 |"...Expr|essionDi|
|000000c0| 63 74 3a 3a 45 78 70 72 | 65 73 73 69 6f 6e 44 69 |ct::Expr|essionDi|
|000000d0| 63 74 28 29 20 3a 0d 09 | 6d 56 61 72 44 69 63 74 |ct() :..|mVarDict|
|000000e0| 28 20 74 72 75 65 20 29 | 20 7b 0d 0d 7d 0d 0d 0d |( true )| {..}...|
|000000f0| 0d 76 6f 69 64 20 45 78 | 70 72 65 73 73 69 6f 6e |.void Ex|pression|
|00000100| 44 69 63 74 3a 3a 41 64 | 64 56 61 72 28 20 63 68 |Dict::Ad|dVar( ch|
|00000110| 61 72 2a 20 69 6e 4b 65 | 79 2c 20 66 6c 6f 61 74 |ar* inKe|y, float|
|00000120| 2a 20 69 6e 50 74 72 20 | 29 20 7b 0d 0d 09 6d 56 |* inPtr |) {...mV|
|00000130| 61 72 44 69 63 74 2e 50 | 75 74 28 20 6e 65 77 20 |arDict.P|ut( new |
|00000140| 55 74 69 6c 53 74 72 28 | 20 69 6e 4b 65 79 20 29 |UtilStr(| inKey )|
|00000150| 2c 20 69 6e 50 74 72 20 | 29 3b 0d 7d 0d 0d 0d 76 |, inPtr |);.}...v|
|00000160| 6f 69 64 20 45 78 70 72 | 65 73 73 69 6f 6e 44 69 |oid Expr|essionDi|
|00000170| 63 74 3a 3a 41 64 64 46 | 63 6e 28 20 63 68 61 72 |ct::AddF|cn( char|
|00000180| 2a 20 69 6e 4b 65 79 2c | 20 66 6c 6f 61 74 2a 20 |* inKey,| float* |
|00000190| 69 6e 46 41 72 72 61 79 | 5b 5d 2c 20 6c 6f 6e 67 |inFArray|[], long|
|000001a0| 20 69 6e 53 69 7a 65 20 | 29 20 7b 0d 09 46 63 6e | inSize |) {..Fcn|
|000001b0| 45 6e 74 72 79 2a 20 65 | 6e 74 72 79 20 3d 20 6e |Entry* e|ntry = n|
|000001c0| 65 77 20 46 63 6e 45 6e | 74 72 79 3b 0d 0d 09 65 |ew FcnEn|try;...e|
|000001d0| 6e 74 72 79 20 2d 3e 20 | 6d 4e 61 6d 65 2e 41 73 |ntry -> |mName.As|
|000001e0| 73 69 67 6e 28 20 69 6e | 4b 65 79 20 29 3b 0d 09 |sign( in|Key );..|
|000001f0| 65 6e 74 72 79 20 2d 3e | 20 6d 4e 61 6d 65 2e 43 |entry ->| mName.C|
|00000200| 61 70 69 74 61 6c 69 7a | 65 28 29 3b 0d 09 65 6e |apitaliz|e();..en|
|00000210| 74 72 79 20 2d 3e 20 6d | 53 69 7a 65 20 3d 20 69 |try -> m|Size = i|
|00000220| 6e 53 69 7a 65 3b 0d 09 | 65 6e 74 72 79 20 2d 3e |nSize;..|entry ->|
|00000230| 20 6d 46 63 6e 20 3d 20 | 69 6e 46 41 72 72 61 79 | mFcn = |inFArray|
|00000240| 3b 0d 09 0d 09 6d 46 63 | 6e 45 6e 74 72 69 65 73 |;....mFc|nEntries|
|00000250| 2e 61 64 64 54 6f 48 65 | 61 64 28 20 65 6e 74 72 |.addToHe|ad( entr|
|00000260| 79 20 29 3b 0d 7d 0d 0d | 0d 66 6c 6f 61 74 2a 20 |y );.}..|.float* |
|00000270| 45 78 70 72 65 73 73 69 | 6f 6e 44 69 63 74 3a 3a |Expressi|onDict::|
|00000280| 4c 6f 6f 6b 75 70 56 61 | 72 28 20 63 6f 6e 73 74 |LookupVa|r( const|
|00000290| 20 55 74 69 6c 53 74 72 | 26 20 69 6e 4e 61 6d 65 | UtilStr|& inName|
|000002a0| 20 29 20 7b 0d 09 66 6c | 6f 61 74 2a 20 61 64 64 | ) {..fl|oat* add|
|000002b0| 72 3b 0d 09 0d 09 69 66 | 20 28 20 6d 56 61 72 44 |r;....if| ( mVarD|
|000002c0| 69 63 74 2e 47 65 74 28 | 20 26 69 6e 4e 61 6d 65 |ict.Get(| &inName|
|000002d0| 2c 20 26 61 64 64 72 20 | 29 20 29 0d 09 09 72 65 |, &addr |) )...re|
|000002e0| 74 75 72 6e 20 61 64 64 | 72 3b 0d 09 65 6c 73 65 |turn add|r;..else|
|000002f0| 0d 09 09 72 65 74 75 72 | 6e 20 4e 55 4c 4c 3b 0d |...retur|n NULL;.|
|00000300| 7d 0d 0d 0d 66 6c 6f 61 | 74 2a 2a 20 45 78 70 72 |}...floa|t** Expr|
|00000310| 65 73 73 69 6f 6e 44 69 | 63 74 3a 3a 4c 6f 6f 6b |essionDi|ct::Look|
|00000320| 75 70 46 75 6e 63 28 20 | 63 6f 6e 73 74 20 55 74 |upFunc( |const Ut|
|00000330| 69 6c 53 74 72 26 20 69 | 6e 4e 61 6d 65 2c 20 6c |ilStr& i|nName, l|
|00000340| 6f 6e 67 26 20 6f 75 74 | 53 69 7a 65 20 29 20 7b |ong& out|Size ) {|
|00000350| 0d 09 46 63 6e 45 6e 74 | 72 79 2a 20 65 6e 74 72 |..FcnEnt|ry* entr|
|00000360| 79 20 3d 20 28 46 63 6e | 45 6e 74 72 79 2a 29 20 |y = (Fcn|Entry*) |
|00000370| 6d 46 63 6e 45 6e 74 72 | 69 65 73 2e 47 65 74 48 |mFcnEntr|ies.GetH|
|00000380| 65 61 64 28 29 3b 0d 09 | 0d 09 77 68 69 6c 65 20 |ead();..|..while |
|00000390| 28 20 65 6e 74 72 79 20 | 29 20 7b 0d 09 09 69 66 |( entry |) {...if|
|000003a0| 20 28 20 65 6e 74 72 79 | 20 2d 3e 20 6d 4e 61 6d | ( entry| -> mNam|
|000003b0| 65 2e 63 6f 6d 70 61 72 | 65 54 6f 28 20 26 69 6e |e.compar|eTo( &in|
|000003c0| 4e 61 6d 65 20 29 20 3d | 3d 20 30 20 29 20 7b 0d |Name ) =|= 0 ) {.|
|000003d0| 09 09 09 6f 75 74 53 69 | 7a 65 20 3d 20 65 6e 74 |...outSi|ze = ent|
|000003e0| 72 79 20 2d 3e 20 6d 53 | 69 7a 65 3b 0d 09 09 09 |ry -> mS|ize;....|
|000003f0| 72 65 74 75 72 6e 20 65 | 6e 74 72 79 20 2d 3e 20 |return e|ntry -> |
|00000400| 6d 46 63 6e 3b 0d 09 09 | 7d 20 0d 09 09 09 0d 09 |mFcn;...|} ......|
|00000410| 09 65 6e 74 72 79 20 3d | 20 28 46 63 6e 45 6e 74 |.entry =| (FcnEnt|
|00000420| 72 79 2a 29 20 65 6e 74 | 72 79 20 2d 3e 20 47 65 |ry*) ent|ry -> Ge|
|00000430| 74 4e 65 78 74 28 29 3b | 0d 09 7d 20 0d 09 0d 09 |tNext();|..} ....|
|00000440| 6f 75 74 53 69 7a 65 20 | 3d 20 30 3b 0d 09 72 65 |outSize |= 0;..re|
|00000450| 74 75 72 6e 20 4e 55 4c | 4c 3b 0d 7d 0d 00 00 00 |turn NUL|L;.}....|
|00000460| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000470| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000480| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00000490| 00 00 04 06 ff ff 20 01 | 94 45 00 00 00 00 04 07 |...... .|.E......|
|000004a0| ff ff 20 01 94 e7 00 00 | 00 00 04 08 ff ff 20 01 |.. .....|...... .|
|000004b0| 95 c1 00 00 00 00 04 09 | ff ff 20 01 96 e7 00 00 |........|.. .....|
|000004c0| 00 00 03 f0 01 b9 20 01 | 98 07 00 00 00 00 03 f7 |...... .|........|
|000004d0| 01 c5 20 01 99 01 00 00 | 00 00 04 0b ff ff 20 01 |.. .....|...... .|
|000004e0| 99 c3 00 00 00 00 04 0c | ff ff 20 01 9a 35 00 00 |........|.. ..5..|
|000004f0| 00 00 04 0d 01 ca 20 01 | 9a a1 00 00 00 00 04 13 |...... .|........|
|00000500| ff ff 20 01 9b 1d 00 00 | 00 00 04 14 ff ff 20 01 |.. .....|...... .|
|00000510| 9c 19 00 00 00 00 04 15 | ff ff 20 01 9c 91 00 00 |........|.. .....|
|00000520| 00 00 04 16 ff ff 00 01 | 9d 97 00 00 00 00 04 17 |........|........|
|00000530| ff ff 20 01 9d b3 00 00 | 00 00 04 11 ff ff 20 01 |.. .....|...... .|
|00000540| 9e b5 00 00 00 00 04 18 | 01 d2 20 01 9f e1 00 00 |........|.. .....|
|00000550| 00 00 03 ea ff ff 20 01 | a1 0b 00 00 00 00 04 19 |...... .|........|
|00000560| 01 d6 20 01 a1 9b 00 00 | 00 00 07 d0 ff ff 20 01 |.. .....|...... .|
|00000570| a2 a1 00 00 00 00 07 d1 | 01 e4 20 01 a3 07 00 00 |........|.. .....|
|00000580| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 03 | 00 04 00 74 00 1c 02 4c |........|...t...L|
|000005b0| 02 72 00 74 00 1c 02 4c | 02 72 b3 74 b5 bb 00 00 |.r.t...L|.r.t....|
|000005c0| 01 c0 00 00 01 c1 00 00 | 00 df 01 00 00 00 00 04 |........|........|
|000005d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000005e0| 00 00 00 46 03 4b ca 84 | 11 44 00 00 00 1c 00 46 |...F.K..|.D.....F|
|000005f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00000600| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00000610| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+