Produced by Araxis Merge on 4/12/2018 10:18:30 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | MSSRe Build 4.zip\Applications\OncoTrax-E40 | ONC_Utilities.cpp | Tue Apr 10 19:43:40 2018 UTC |
| 2 | MSSRe Build 4.zip\Applications\OncoTrax-E40 | ONC_Utilities.cpp | Wed Apr 11 17:42:03 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 498 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 2 | /* Packag e: ON C – Oncolo gy * / | |
| 3 | /* Date C reated: Ju l 26,2004 * / | |
| 4 | /* Site N ame: Hi nes OIFO * / | |
| 5 | /* Developers : Sergey Gav rilov PII ) */ | |
| 6 | /* Descri ption: Ut ilities fo r Oncology Web-servi ce * / | |
| 7 | /********* ********** ********** ********** ********** ********** ********** ********** / | |
| 8 | ||
| 9 | #include " stdafx.h" | |
| 10 | #include " OncologyCG I.h" | |
| 11 | ||
| 12 | //***** RE TURNS THE PATH WHERE THE PROGR AM WAS LAU NCHED FROM | |
| 13 | ||
| 14 | const char * getAppPa th() | |
| 15 | { | |
| 16 | st atic char app_path[_ MAX_PATH] = ""; | |
| 17 | if ( strlen(a pp_path) = = 0 ) | |
| 18 | { | |
| 19 | char drive[_MA X_DRIVE], dir[_MAX_D IR], fname [_MAX_FNAM E], ext[_M AX_EXT]; | |
| 20 | ||
| 21 | //JJB 1001 05 the str 's became _s version s | |
| 22 | _spl itpath_s( __argv[0], drive, si zeof(drive ), | |
| 23 | dir, s izeof(dir) , fname, s izeof(fnam e), ext, s izeof(ext) ); | |
| 24 | strc at_s(app_p ath, sizeo f(app_path ), drive); | |
| 25 | strc at_s(app_p ath, sizeo f(app_path ), dir); | |
| 26 | } | |
| 27 | re turn app_p ath; | |
| 28 | } | |
| 29 | ||
| 30 | //***** OU TPUTS THE PAIR OF TA GS AROUND THE INTEGE R VALUE | |
| 31 | ||
| 32 | void IntTa g(const ch ar *name, int val) | |
| 33 | { | |
| 34 | pr intf("<%s> %d</%s>\n" , name, va l, name); | |
| 35 | } | |
| 36 | ||
| 37 | //***** AN ALOGUE OF THE $PIECE FUNCTION IN MUMPS | |
| 38 | ||
| 39 | string Pie ce( | |
| 40 | st ring Value , // Source string | |
| 41 | st ring Delim iter, // Delimit er string | |
| 42 | co nst int St artPiece, // Seque ntial numb er of the start piec e | |
| 43 | co nst int En dPiece) // Sequent ial number of the en d piece | |
| 44 | { | |
| 45 | if ( Value.le ngth()>0 & & StartPie ce>0 && En dPiece>=St artPiece ) | |
| 46 | { | |
| 47 | size _t dlen = Delimiter. length(), end, resle n, start = 0; | |
| 48 | int pnum; | |
| 49 | for( pnum=1; p num < Star tPiece; pn um++ ) | |
| 50 | { | |
| 51 | start = Value.fi nd(Delimit er, start) ; | |
| 52 | if( st art != Val ue.npos ) | |
| 53 | start += dlen; | |
| 54 | else b reak; | |
| 55 | } | |
| 56 | if( start != V alue.npos ) | |
| 57 | { | |
| 58 | end = Value.find (Delimiter , start); | |
| 59 | for( ; pnum < En dPiece && end != Val ue.npos; p num++ ) | |
| 60 | end = Va lue.find(D elimiter, end+dlen); | |
| 61 | reslen = end != Value.npos ? end - s tart: Valu e.length() - start; | |
| 62 | return Value.sub str(start, reslen); | |
| 63 | } | |
| 64 | } | |
| 65 | re turn ""; | |
| 66 | } | |
| 67 | ||
| 68 | string Pie ce(string Value, str ing Delimi ter, const int Start Piece) | |
| 69 | { | |
| 70 | re turn Piece (Value, De limiter, S tartPiece, StartPiec e); | |
| 71 | } | |
| 72 | ||
| 73 | //***** OU TPUTS THE PAIR OF TA GS AROUND THE STRING VALUE | |
| 74 | ||
| 75 | void StrTa g(const ch ar *name, const char *val) | |
| 76 | { | |
| 77 | pr intf("<%s> ", name); | |
| 78 | wr iteText(va l); | |
| 79 | pr intf("</%s >\n", name ); | |
| 80 | } | |
| 81 | ||
| 82 | //***** ES CAPES (GEN ERAL ENTIT IES) THE T EXT AND WR APS THE LI NES KEEPIN G THE ORIG INAL STRUC TURE | |
| 83 | // Outputs the <P> a nd </P> ta gs to mark the origi nal lines. | |
| 84 | ||
| 85 | void write Structured Text(const char* tex t) | |
| 86 | { | |
| 87 | co nst int ma xlen2 = 24 0, maxlen1 = maxlen2 -20; | |
| 88 | si ze_t i, le n = 0, txt len = strl en(text); | |
| 89 | bo ol nl = tr ue; | |
| 90 | ||
| 91 | if ( !txtlen ) | |
| 92 | { | |
| 93 | puts ("<P></P>" ); | |
| 94 | retu rn; | |
| 95 | } | |
| 96 | ||
| 97 | fo r( i=0; i< txtlen; i+ + ) | |
| 98 | { | |
| 99 | if( nl ) | |
| 100 | { | |
| 101 | printf ("<P>"); | |
| 102 | nl = f alse; | |
| 103 | } | |
| 104 | if( len >= max len2 ) | |
| 105 | { | |
| 106 | puts(" "); | |
| 107 | len = 0; | |
| 108 | } | |
| 109 | swit ch(text[i] ) | |
| 110 | { | |
| 111 | case '\r': // Do no t separate this case from the '\n'! | |
| 112 | if(tex t[i+1] == '\n' ) i++ ; | |
| 113 | case '\n': // Do no t separate this case from the '\r'! | |
| 114 | puts(" </P>"); | |
| 115 | nl = t rue; | |
| 116 | break; | |
| 117 | case '&': | |
| 118 | printf ("&"); | |
| 119 | len += 5; | |
| 120 | break; | |
| 121 | case '<': | |
| 122 | printf ("<"); | |
| 123 | len += 4; | |
| 124 | break; | |
| 125 | case '>': | |
| 126 | printf (">"); | |
| 127 | len += 4; | |
| 128 | break; | |
| 129 | case '\'': | |
| 130 | printf ("'") ; | |
| 131 | len += 6; | |
| 132 | break; | |
| 133 | case '\"': | |
| 134 | printf (""") ; | |
| 135 | len += 6; | |
| 136 | break; | |
| 137 | case ' ': // Do no t separate this case from the default on e! | |
| 138 | if( le n >= maxle n1 ) | |
| 139 | { | |
| 140 | puts(" " ); | |
| 141 | len = 0; | |
| 142 | break; | |
| 143 | } | |
| 144 | defa ult: // Do no t separate this case from the ' '! | |
| 145 | putcha r(text[i]) ; | |
| 146 | len += 1; | |
| 147 | break; | |
| 148 | } | |
| 149 | } | |
| 150 | ||
| 151 | if ( !nl ) pu ts("</P>") ; | |
| 152 | } | |
| 153 | ||
| 154 | //***** ES CAPES (GEN ERAL ENTIT IES) AND R EFORMATS T HE TEXT | |
| 155 | ||
| 156 | void write Text(const char* tex t, bool cr lf) | |
| 157 | { | |
| 158 | co nst int ma xlen2 = 24 0, maxlen1 = maxlen2 -20; | |
| 159 | si ze_t i, le n = 0, txt len = strl en(text); | |
| 160 | ||
| 161 | fo r( i=0; i< txtlen; i+ + ) | |
| 162 | { | |
| 163 | if( len >= max len2 ) | |
| 164 | { | |
| 165 | puts(" "); | |
| 166 | len = 0; | |
| 167 | } | |
| 168 | swit ch(text[i] ) | |
| 169 | { | |
| 170 | case '&': | |
| 171 | printf ("&"); | |
| 172 | len += 5; | |
| 173 | break; | |
| 174 | case '<': | |
| 175 | printf ("<"); | |
| 176 | len += 4; | |
| 177 | break; | |
| 178 | case '>': | |
| 179 | printf (">"); | |
| 180 | len += 4; | |
| 181 | break; | |
| 182 | case '\'': | |
| 183 | printf ("'") ; | |
| 184 | len += 6; | |
| 185 | break; | |
| 186 | case '\"': | |
| 187 | printf (""") ; | |
| 188 | len += 6; | |
| 189 | break; | |
| 190 | case ' ': // Do no t separate this case from the default on e! | |
| 191 | if( le n >= maxle n1 ) | |
| 192 | { | |
| 193 | puts(" " ); | |
| 194 | len = 0; | |
| 195 | break; | |
| 196 | } | |
| 197 | defa ult: // Do no t separate the defau lt case fr om the ' ' ! | |
| 198 | putcha r(text[i]) ; | |
| 199 | len += 1; | |
| 200 | break; | |
| 201 | } | |
| 202 | } | |
| 203 | ||
| 204 | if ( crlf ) p uts(""); | |
| 205 | } | |
| 206 | ||
| 207 | //***** EN CODES GENE RAL ENTITI ES ACCORDI NG TO XML RULES | |
| 208 | ||
| 209 | string xml Encode(str ing str) | |
| 210 | { | |
| 211 | st atic const string EC H( "<&\'\" >" ); | |
| 212 | si ze_t i1, i 2, sl = st r.length() ; | |
| 213 | st ring resul t( "" ); | |
| 214 | ||
| 215 | i2 = -1; | |
| 216 | wh ile( 1 ) | |
| 217 | { | |
| 218 | i1 = i2 + 1; | |
| 219 | if( i1 >= sl ) | |
| 220 | break; | |
| 221 | i2 = str.find_ first_of(E CH, i1); | |
| 222 | if( i2 == str. npos ) | |
| 223 | break; | |
| 224 | if( i2 > i1 ) | |
| 225 | result += str.su bstr(i1, i 2-i1); | |
| 226 | swit ch(str[i2] ) | |
| 227 | { | |
| 228 | case '&': | |
| 229 | result += "& "; | |
| 230 | break; | |
| 231 | case '<': | |
| 232 | result += "<" ; | |
| 233 | break; | |
| 234 | case '>': | |
| 235 | result += ">" ; | |
| 236 | break; | |
| 237 | case '\'': | |
| 238 | result += "&apos ;"; | |
| 239 | break; | |
| 240 | case '\"': | |
| 241 | result += "" ;"; | |
| 242 | break; | |
| 243 | } | |
| 244 | } | |
| 245 | ||
| 246 | if ( i1 < sl ) | |
| 247 | resu lt += str. substr(i1, sl-i1); | |
| 248 | ||
| 249 | re turn resul t; | |
| 250 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.