GPCStrings.pas 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. {
  2. FPC unit compatible with GPC support for handling UCSD-Pascal strings.
  3. }
  4. {
  5. Modified for use with FPC Pascal
  6. Adapted from Version 200 of the GPC unit by <[email protected]>
  7. Please report any bugs to <[email protected]>
  8. }
  9. {$inline on}
  10. {
  11. Modified for use with Free Pascal
  12. Version 210
  13. Please report any bugs to <[email protected]>
  14. }
  15. {$mode macpas}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$calling mwpascal}
  20. unit GPCStrings;
  21. interface
  22. {$definec UNIVERSAL_INTERFACES_VERSION $0342}
  23. {$definec GAP_INTERFACES_VERSION $0210}
  24. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  25. {$definec USE_CFSTR_CONSTANT_MACROS TRUE}
  26. {$endc}
  27. {$ifc defined CPUPOWERPC and defined CPUI386}
  28. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  29. {$endc}
  30. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  31. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  32. {$endc}
  33. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  34. {$setc __ppc__ := 1}
  35. {$elsec}
  36. {$setc __ppc__ := 0}
  37. {$endc}
  38. {$ifc not defined __i386__ and defined CPUI386}
  39. {$setc __i386__ := 1}
  40. {$elsec}
  41. {$setc __i386__ := 0}
  42. {$endc}
  43. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  44. {$error Conflicting definitions for __ppc__ and __i386__}
  45. {$endc}
  46. {$ifc defined __ppc__ and __ppc__}
  47. {$setc TARGET_CPU_PPC := TRUE}
  48. {$setc TARGET_CPU_X86 := FALSE}
  49. {$elifc defined __i386__ and __i386__}
  50. {$setc TARGET_CPU_PPC := FALSE}
  51. {$setc TARGET_CPU_X86 := TRUE}
  52. {$elsec}
  53. {$error Neither __ppc__ nor __i386__ is defined.}
  54. {$endc}
  55. {$setc TARGET_CPU_PPC_64 := FALSE}
  56. {$ifc defined FPC_BIG_ENDIAN}
  57. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  58. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  59. {$elifc defined FPC_LITTLE_ENDIAN}
  60. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  61. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  62. {$elsec}
  63. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  64. {$endc}
  65. {$definec ACCESSOR_CALLS_ARE_FUNCTIONS TRUE}
  66. {$definec CALL_NOT_IN_CARBON FALSE}
  67. {$definec OLDROUTINENAMES FALSE}
  68. {$definec OPAQUE_TOOLBOX_STRUCTS TRUE}
  69. {$definec OPAQUE_UPP_TYPES TRUE}
  70. {$definec OTCARBONAPPLICATION TRUE}
  71. {$definec OTKERNEL FALSE}
  72. {$definec PM_USE_SESSION_APIS TRUE}
  73. {$definec TARGET_API_MAC_CARBON TRUE}
  74. {$definec TARGET_API_MAC_OS8 FALSE}
  75. {$definec TARGET_API_MAC_OSX TRUE}
  76. {$definec TARGET_CARBON TRUE}
  77. {$definec TARGET_CPU_68K FALSE}
  78. {$definec TARGET_CPU_MIPS FALSE}
  79. {$definec TARGET_CPU_SPARC FALSE}
  80. {$definec TARGET_OS_MAC TRUE}
  81. {$definec TARGET_OS_UNIX FALSE}
  82. {$definec TARGET_OS_WIN32 FALSE}
  83. {$definec TARGET_RT_MAC_68881 FALSE}
  84. {$definec TARGET_RT_MAC_CFM FALSE}
  85. {$definec TARGET_RT_MAC_MACHO TRUE}
  86. {$definec TYPED_FUNCTION_POINTERS TRUE}
  87. {$definec TYPE_BOOL FALSE}
  88. {$definec TYPE_EXTENDED FALSE}
  89. {$definec TYPE_LONGLONG TRUE}
  90. uses MacTypes;
  91. const
  92. kEmptyStr15 : Str15 = '';
  93. kEmptyStr27 : Str27 = '';
  94. kEmptyStr31 : Str31 = '';
  95. kEmptyStr32 : Str32 = '';
  96. kEmptyStr63 : Str63 = '';
  97. kEmptyStr255 : Str255 = '';
  98. type
  99. String15 = String[15];
  100. String27 = String[27];
  101. String31 = String[31];
  102. String32 = String[32];
  103. String36 = String[36];
  104. String63 = String[63];
  105. String255 = String[255];
  106. function Str15Length( const s: Str15 ) : Integer; inline;
  107. function Str27Length( const s: Str27 ) : Integer; inline;
  108. function Str31Length( const s: Str31 ) : Integer; inline;
  109. function Str32Length( const s: Str32 ) : Integer; inline;
  110. function Str63Length( const s: Str63 ) : Integer; inline;
  111. function Str255Length( const s: Str255 ) : Integer; inline;
  112. procedure SetStr15Length( var s: Str15; len: Integer ); inline;
  113. procedure SetStr27Length( var s: Str27; len: Integer ); inline;
  114. procedure SetStr31Length( var s: Str31; len: Integer ); inline;
  115. procedure SetStr32Length( var s: Str32; len: Integer ); inline;
  116. procedure SetStr63Length( var s: Str63; len: Integer ); inline;
  117. procedure SetStr255Length( var s: Str255; len: Integer ); inline;
  118. function CharToStr15( ch: char) : Str15; inline;
  119. function CharToStr27( ch: char) : Str27; inline;
  120. function CharToStr31( ch: char) : Str31; inline;
  121. function CharToStr32( ch: char) : Str32; inline;
  122. function CharToStr63( ch: char) : Str63; inline;
  123. function CharToStr255( ch: char) : Str255; inline;
  124. function Str15ToStr15 ( const s: Str15 ) : Str15; inline;
  125. function Str15ToStr27 ( const s: Str15 ) : Str27; inline;
  126. function Str15ToStr31 ( const s: Str15 ) : Str31; inline;
  127. function Str15ToStr32 ( const s: Str15 ) : Str32; inline;
  128. function Str15ToStr63 ( const s: Str15 ) : Str63; inline;
  129. function Str15ToStr255 ( const s: Str15 ) : Str255; inline;
  130. function Str27ToStr15 ( const s: Str27 ) : Str15; inline;
  131. function Str27ToStr27 ( const s: Str27 ) : Str27; inline;
  132. function Str27ToStr31 ( const s: Str27 ) : Str31; inline;
  133. function Str27ToStr32 ( const s: Str27 ) : Str32; inline;
  134. function Str27ToStr63 ( const s: Str27 ) : Str63; inline;
  135. function Str27ToStr255 ( const s: Str27 ) : Str255; inline;
  136. function Str31ToStr15 ( const s: Str31 ) : Str15; inline;
  137. function Str31ToStr27 ( const s: Str31 ) : Str27; inline;
  138. function Str31ToStr31 ( const s: Str31 ) : Str31; inline;
  139. function Str31ToStr32 ( const s: Str31 ) : Str32; inline;
  140. function Str31ToStr63 ( const s: Str31 ) : Str63; inline;
  141. function Str31ToStr255 ( const s: Str31 ) : Str255; inline;
  142. function Str32ToStr15 ( const s: Str32 ) : Str15; inline;
  143. function Str32ToStr27 ( const s: Str32 ) : Str27; inline;
  144. function Str32ToStr31 ( const s: Str32 ) : Str31; inline;
  145. function Str32ToStr32 ( const s: Str32 ) : Str32; inline;
  146. function Str32ToStr63 ( const s: Str32 ) : Str63; inline;
  147. function Str32ToStr255 ( const s: Str32 ) : Str255; inline;
  148. function Str63ToStr15 ( const s: Str63 ) : Str15; inline;
  149. function Str63ToStr27 ( const s: Str63 ) : Str27; inline;
  150. function Str63ToStr31 ( const s: Str63 ) : Str31; inline;
  151. function Str63ToStr32 ( const s: Str63 ) : Str32; inline;
  152. function Str63ToStr63 ( const s: Str63 ) : Str63; inline;
  153. function Str63ToStr255 ( const s: Str63 ) : Str255; inline;
  154. function Str255ToStr15 ( const s: Str255 ) : Str15; inline;
  155. function Str255ToStr27 ( const s: Str255 ) : Str27; inline;
  156. function Str255ToStr31 ( const s: Str255 ) : Str31; inline;
  157. function Str255ToStr32 ( const s: Str255 ) : Str32; inline;
  158. function Str255ToStr63 ( const s: Str255 ) : Str63; inline;
  159. function Str255ToStr255 ( const s: Str255 ) : Str255; inline;
  160. procedure Str15IntoStr15 ( const s: Str15; var theResult: Str15 ); inline;
  161. procedure Str15IntoStr27 ( const s: Str15; var theResult: Str27 ); inline;
  162. procedure Str15IntoStr31 ( const s: Str15; var theResult: Str31 ); inline;
  163. procedure Str15IntoStr32 ( const s: Str15; var theResult: Str32 ); inline;
  164. procedure Str15IntoStr63 ( const s: Str15; var theResult: Str63 ); inline;
  165. procedure Str15IntoStr255 ( const s: Str15; var theResult: Str255 ); inline;
  166. procedure Str27IntoStr15 ( const s: Str27; var theResult: Str15 ); inline;
  167. procedure Str27IntoStr27 ( const s: Str27; var theResult: Str27 ); inline;
  168. procedure Str27IntoStr31 ( const s: Str27; var theResult: Str31 ); inline;
  169. procedure Str27IntoStr32 ( const s: Str27; var theResult: Str32 ); inline;
  170. procedure Str27IntoStr63 ( const s: Str27; var theResult: Str63 ); inline;
  171. procedure Str27IntoStr255 ( const s: Str27; var theResult: Str255 ); inline;
  172. procedure Str31IntoStr15 ( const s: Str31; var theResult: Str15 ); inline;
  173. procedure Str31IntoStr27 ( const s: Str31; var theResult: Str27 ); inline;
  174. procedure Str31IntoStr31 ( const s: Str31; var theResult: Str31 ); inline;
  175. procedure Str31IntoStr32 ( const s: Str31; var theResult: Str32 ); inline;
  176. procedure Str31IntoStr63 ( const s: Str31; var theResult: Str63 ); inline;
  177. procedure Str31IntoStr255 ( const s: Str31; var theResult: Str255 ); inline;
  178. procedure Str32IntoStr15 ( const s: Str32; var theResult: Str15 ); inline;
  179. procedure Str32IntoStr27 ( const s: Str32; var theResult: Str27 ); inline;
  180. procedure Str32IntoStr31 ( const s: Str32; var theResult: Str31 ); inline;
  181. procedure Str32IntoStr32 ( const s: Str32; var theResult: Str32 ); inline;
  182. procedure Str32IntoStr63 ( const s: Str32; var theResult: Str63 ); inline;
  183. procedure Str32IntoStr255 ( const s: Str32; var theResult: Str255 ); inline;
  184. procedure Str63IntoStr15 ( const s: Str63; var theResult: Str15 ); inline;
  185. procedure Str63IntoStr27 ( const s: Str63; var theResult: Str27 ); inline;
  186. procedure Str63IntoStr31 ( const s: Str63; var theResult: Str31 ); inline;
  187. procedure Str63IntoStr32 ( const s: Str63; var theResult: Str32 ); inline;
  188. procedure Str63IntoStr63 ( const s: Str63; var theResult: Str63 ); inline;
  189. procedure Str63IntoStr255 ( const s: Str63; var theResult: Str255 ); inline;
  190. procedure Str255IntoStr15 ( const s: Str255; var theResult: Str15 ); inline;
  191. procedure Str255IntoStr27 ( const s: Str255; var theResult: Str27 ); inline;
  192. procedure Str255IntoStr31 ( const s: Str255; var theResult: Str31 ); inline;
  193. procedure Str255IntoStr32 ( const s: Str255; var theResult: Str32 ); inline;
  194. procedure Str255IntoStr63 ( const s: Str255; var theResult: Str63 ); inline;
  195. procedure Str255IntoStr255 ( const s: Str255; var theResult: Str255 ); inline;
  196. function StringToStr15( const s: String ) : Str15; inline;
  197. procedure StringIntoStr15( const s: String; var theResult: Str15 ); inline;
  198. function StringToStr27( const s: String ) : Str27; inline;
  199. procedure StringIntoStr27( const s: String; var theResult: Str27 ); inline;
  200. function StringToStr31( const s: String ) : Str31; inline;
  201. procedure StringIntoStr31( const s: String; var theResult: Str31 ); inline;
  202. function StringToStr32( const s: String ) : Str32; inline;
  203. procedure StringIntoStr32( const s: String; var theResult: Str32 ); inline;
  204. function StringToStr63( const s: String ) : Str63; inline;
  205. procedure StringIntoStr63( const s: String; var theResult: Str63 ); inline;
  206. function StringToStr255( const s: String ) : Str255; inline;
  207. procedure StringIntoStr255( const s: String; var theResult: Str255 ); inline;
  208. function Str15ToString( const s: Str15 ) : String15; inline;
  209. function Str27ToString( const s: Str27 ) : String27; inline;
  210. function Str31ToString( const s: Str31 ) : String31; inline;
  211. function Str32ToString( const s: Str32 ) : String32; inline;
  212. function Str63ToString( const s: Str63 ) : String63; inline;
  213. function Str255ToString( const s: Str255 ) : String255; inline;
  214. procedure InitStr15( var s: Str15); inline;
  215. procedure InitStr27( var s: Str27); inline;
  216. procedure InitStr31( var s: Str31); inline;
  217. procedure InitStr32( var s: Str32); inline;
  218. procedure InitStr63( var s: Str63); inline;
  219. procedure InitStr255( var s: Str255); inline;
  220. function CopyStr15( const theSource: Str15; theStart, theCount: Integer) : Str255; inline;
  221. function CopyStr27( const theSource: Str27; theStart, theCount: Integer) : Str255; inline;
  222. function CopyStr31( const theSource: Str31; theStart, theCount: Integer) : Str255; inline;
  223. function CopyStr32( const theSource: Str32; theStart, theCount: Integer) : Str255; inline;
  224. function CopyStr63( const theSource: Str63; theStart, theCount: Integer) : Str255; inline;
  225. function CopyStr255( const theSource: Str255; theStart, theCount: Integer) : Str255; inline;
  226. procedure DeleteStr15( var theDest: Str15; theStart, theCount: Integer); inline;
  227. procedure DeleteStr27( var theDest: Str27; theStart, theCount: Integer); inline;
  228. procedure DeleteStr31( var theDest: Str31; theStart, theCount: Integer); inline;
  229. procedure DeleteStr32( var theDest: Str32; theStart, theCount: Integer); inline;
  230. procedure DeleteStr63( var theDest: Str63; theStart, theCount: Integer); inline;
  231. procedure DeleteStr255( var theDest: Str255; theStart, theCount: Integer); inline;
  232. procedure InsertStr255( const theSource: Str255; var theDest: Str255; theStart: Integer); inline;
  233. function PosCharInStr15( theCh: Char; const theStr: Str15) : Integer; inline;
  234. function PosCharInStr27( theCh: Char; const theStr: Str27) : Integer; inline;
  235. function PosCharInStr31( theCh: Char; const theStr: Str31) : Integer; inline;
  236. function PosCharInStr32( theCh: Char; const theStr: Str32) : Integer; inline;
  237. function PosCharInStr63( theCh: Char; const theStr: Str63) : Integer; inline;
  238. function PosCharInStr255( theCh: Char; const theStr: Str255) : Integer; inline;
  239. function PosInStr255( const theSubStr, theSourceStr: Str255) : Integer; inline;
  240. implementation
  241. {$R-}
  242. function Str15Length( const s: Str15 ) : Integer; inline;
  243. begin
  244. result := length(s);
  245. end;
  246. function Str27Length( const s: Str27 ) : Integer;
  247. begin
  248. result := length(s);
  249. end;
  250. function Str31Length( const s: Str31 ) : Integer;
  251. begin
  252. result := length(s);
  253. end;
  254. function Str32Length( const s: Str32 ) : Integer;
  255. begin
  256. result := length(s);
  257. end;
  258. function Str63Length( const s: Str63 ) : Integer;
  259. begin
  260. result := length(s);
  261. end;
  262. function Str255Length( const s: Str255 ) : Integer;
  263. begin
  264. result := length(s);
  265. end;
  266. procedure SetStr15Length( var s: Str15; len: Integer );
  267. begin
  268. setlength(s,len);
  269. end;
  270. procedure SetStr27Length( var s: Str27; len: Integer );
  271. begin
  272. setlength(s,len);
  273. end;
  274. procedure SetStr31Length( var s: Str31; len: Integer );
  275. begin
  276. setlength(s,len);
  277. end;
  278. procedure SetStr32Length( var s: Str32; len: Integer );
  279. begin
  280. setlength(s,len);
  281. end;
  282. procedure SetStr63Length( var s: Str63; len: Integer );
  283. begin
  284. setlength(s,len);
  285. end;
  286. procedure SetStr255Length( var s: Str255; len: Integer );
  287. begin
  288. setlength(s,len);
  289. end;
  290. function CharToStr15( ch: char): Str15;
  291. begin
  292. result := ch;
  293. end;
  294. function CharToStr27( ch: char) : Str27;
  295. begin
  296. result := ch;
  297. end;
  298. function CharToStr31( ch: char) : Str31;
  299. begin
  300. result := ch;
  301. end;
  302. function CharToStr32( ch: char) : Str32;
  303. begin
  304. result := ch;
  305. end;
  306. function CharToStr63( ch: char) : Str63;
  307. begin
  308. result := ch;
  309. end;
  310. function CharToStr255( ch: char) : Str255;
  311. begin
  312. result := ch;
  313. end;
  314. function Str15ToStr15 ( const s: Str15 ) : Str15;
  315. begin
  316. result := s;
  317. end;
  318. function Str15ToStr27 ( const s: Str15 ) : Str27;
  319. begin
  320. result := s;
  321. end;
  322. function Str15ToStr31 ( const s: Str15 ) : Str31;
  323. begin
  324. result := s;
  325. end;
  326. function Str15ToStr32 ( const s: Str15 ) : Str32;
  327. begin
  328. result := s;
  329. end;
  330. function Str15ToStr63 ( const s: Str15 ) : Str63;
  331. begin
  332. result := s;
  333. end;
  334. function Str15ToStr255 ( const s: Str15 ) : Str255;
  335. begin
  336. result := s;
  337. end;
  338. function Str27ToStr15 ( const s: Str27 ) : Str15;
  339. begin
  340. result := s;
  341. end;
  342. function Str27ToStr27 ( const s: Str27 ) : Str27;
  343. begin
  344. result := s;
  345. end;
  346. function Str27ToStr31 ( const s: Str27 ) : Str31;
  347. begin
  348. result := s;
  349. end;
  350. function Str27ToStr32 ( const s: Str27 ) : Str32;
  351. begin
  352. result := s;
  353. end;
  354. function Str27ToStr63 ( const s: Str27 ) : Str63;
  355. begin
  356. result := s;
  357. end;
  358. function Str27ToStr255 ( const s: Str27 ) : Str255;
  359. begin
  360. result := s;
  361. end;
  362. function Str31ToStr15 ( const s: Str31 ) : Str15;
  363. begin
  364. result := s;
  365. end;
  366. function Str31ToStr27 ( const s: Str31 ) : Str27;
  367. begin
  368. result := s;
  369. end;
  370. function Str31ToStr31 ( const s: Str31 ) : Str31;
  371. begin
  372. result := s;
  373. end;
  374. function Str31ToStr32 ( const s: Str31 ) : Str32;
  375. begin
  376. result := s;
  377. end;
  378. function Str31ToStr63 ( const s: Str31 ) : Str63;
  379. begin
  380. result := s;
  381. end;
  382. function Str31ToStr255 ( const s: Str31 ) : Str255;
  383. begin
  384. result := s;
  385. end;
  386. function Str32ToStr15 ( const s: Str32 ) : Str15;
  387. begin
  388. result := s;
  389. end;
  390. function Str32ToStr27 ( const s: Str32 ) : Str27;
  391. begin
  392. result := s;
  393. end;
  394. function Str32ToStr31 ( const s: Str32 ) : Str31;
  395. begin
  396. result := s;
  397. end;
  398. function Str32ToStr32 ( const s: Str32 ) : Str32;
  399. begin
  400. result := s;
  401. end;
  402. function Str32ToStr63 ( const s: Str32 ) : Str63;
  403. begin
  404. result := s;
  405. end;
  406. function Str32ToStr255 ( const s: Str32 ) : Str255;
  407. begin
  408. result := s;
  409. end;
  410. function Str63ToStr15 ( const s: Str63 ) : Str15;
  411. begin
  412. result := s;
  413. end;
  414. function Str63ToStr27 ( const s: Str63 ) : Str27;
  415. begin
  416. result := s;
  417. end;
  418. function Str63ToStr31 ( const s: Str63 ) : Str31;
  419. begin
  420. result := s;
  421. end;
  422. function Str63ToStr32 ( const s: Str63 ) : Str32;
  423. begin
  424. result := s;
  425. end;
  426. function Str63ToStr63 ( const s: Str63 ) : Str63;
  427. begin
  428. result := s;
  429. end;
  430. function Str63ToStr255 ( const s: Str63 ) : Str255;
  431. begin
  432. result := s;
  433. end;
  434. function Str255ToStr15 ( const s: Str255 ) : Str15;
  435. begin
  436. result := s;
  437. end;
  438. function Str255ToStr27 ( const s: Str255 ) : Str27;
  439. begin
  440. result := s;
  441. end;
  442. function Str255ToStr31 ( const s: Str255 ) : Str31;
  443. begin
  444. result := s;
  445. end;
  446. function Str255ToStr32 ( const s: Str255 ) : Str32;
  447. begin
  448. result := s;
  449. end;
  450. function Str255ToStr63 ( const s: Str255 ) : Str63;
  451. begin
  452. result := s;
  453. end;
  454. function Str255ToStr255 ( const s: Str255 ) : Str255;
  455. begin
  456. result := s;
  457. end;
  458. procedure Str15IntoStr15 ( const s: Str15; var theResult: Str15 );
  459. begin
  460. theResult := s;
  461. end;
  462. procedure Str15IntoStr27 ( const s: Str15; var theResult: Str27 );
  463. begin
  464. theResult := s;
  465. end;
  466. procedure Str15IntoStr31 ( const s: Str15; var theResult: Str31 );
  467. begin
  468. theResult := s;
  469. end;
  470. procedure Str15IntoStr32 ( const s: Str15; var theResult: Str32 );
  471. begin
  472. theResult := s;
  473. end;
  474. procedure Str15IntoStr63 ( const s: Str15; var theResult: Str63 );
  475. begin
  476. theResult := s;
  477. end;
  478. procedure Str15IntoStr255 ( const s: Str15; var theResult: Str255 );
  479. begin
  480. theResult := s;
  481. end;
  482. procedure Str27IntoStr15 ( const s: Str27; var theResult: Str15 );
  483. begin
  484. theResult := s;
  485. end;
  486. procedure Str27IntoStr27 ( const s: Str27; var theResult: Str27 );
  487. begin
  488. theResult := s;
  489. end;
  490. procedure Str27IntoStr31 ( const s: Str27; var theResult: Str31 );
  491. begin
  492. theResult := s;
  493. end;
  494. procedure Str27IntoStr32 ( const s: Str27; var theResult: Str32 );
  495. begin
  496. theResult := s;
  497. end;
  498. procedure Str27IntoStr63 ( const s: Str27; var theResult: Str63 );
  499. begin
  500. theResult := s;
  501. end;
  502. procedure Str27IntoStr255 ( const s: Str27; var theResult: Str255 );
  503. begin
  504. theResult := s;
  505. end;
  506. procedure Str31IntoStr15 ( const s: Str31; var theResult: Str15 );
  507. begin
  508. theResult := s;
  509. end;
  510. procedure Str31IntoStr27 ( const s: Str31; var theResult: Str27 );
  511. begin
  512. theResult := s;
  513. end;
  514. procedure Str31IntoStr31 ( const s: Str31; var theResult: Str31 );
  515. begin
  516. theResult := s;
  517. end;
  518. procedure Str31IntoStr32 ( const s: Str31; var theResult: Str32 );
  519. begin
  520. theResult := s;
  521. end;
  522. procedure Str31IntoStr63 ( const s: Str31; var theResult: Str63 );
  523. begin
  524. theResult := s;
  525. end;
  526. procedure Str31IntoStr255 ( const s: Str31; var theResult: Str255 );
  527. begin
  528. theResult := s;
  529. end;
  530. procedure Str32IntoStr15 ( const s: Str32; var theResult: Str15 );
  531. begin
  532. theResult := s;
  533. end;
  534. procedure Str32IntoStr27 ( const s: Str32; var theResult: Str27 );
  535. begin
  536. theResult := s;
  537. end;
  538. procedure Str32IntoStr31 ( const s: Str32; var theResult: Str31 );
  539. begin
  540. theResult := s;
  541. end;
  542. procedure Str32IntoStr32 ( const s: Str32; var theResult: Str32 );
  543. begin
  544. theResult := s;
  545. end;
  546. procedure Str32IntoStr63 ( const s: Str32; var theResult: Str63 );
  547. begin
  548. theResult := s;
  549. end;
  550. procedure Str32IntoStr255 ( const s: Str32; var theResult: Str255 );
  551. begin
  552. theResult := s;
  553. end;
  554. procedure Str63IntoStr15 ( const s: Str63; var theResult: Str15 );
  555. begin
  556. theResult := s;
  557. end;
  558. procedure Str63IntoStr27 ( const s: Str63; var theResult: Str27 );
  559. begin
  560. theResult := s;
  561. end;
  562. procedure Str63IntoStr31 ( const s: Str63; var theResult: Str31 );
  563. begin
  564. theResult := s;
  565. end;
  566. procedure Str63IntoStr32 ( const s: Str63; var theResult: Str32 );
  567. begin
  568. theResult := s;
  569. end;
  570. procedure Str63IntoStr63 ( const s: Str63; var theResult: Str63 );
  571. begin
  572. theResult := s;
  573. end;
  574. procedure Str63IntoStr255 ( const s: Str63; var theResult: Str255 );
  575. begin
  576. theResult := s;
  577. end;
  578. procedure Str255IntoStr15 ( const s: Str255; var theResult: Str15 );
  579. begin
  580. theResult := s;
  581. end;
  582. procedure Str255IntoStr27 ( const s: Str255; var theResult: Str27 );
  583. begin
  584. theResult := s;
  585. end;
  586. procedure Str255IntoStr31 ( const s: Str255; var theResult: Str31 );
  587. begin
  588. theResult := s;
  589. end;
  590. procedure Str255IntoStr32 ( const s: Str255; var theResult: Str32 );
  591. begin
  592. theResult := s;
  593. end;
  594. procedure Str255IntoStr63 ( const s: Str255; var theResult: Str63 );
  595. begin
  596. theResult := s;
  597. end;
  598. procedure Str255IntoStr255 ( const s: Str255; var theResult: Str255 );
  599. begin
  600. theResult := s;
  601. end;
  602. function StringToStr15( const s: String ) : Str15;
  603. begin
  604. result := s;
  605. end;
  606. procedure StringIntoStr15( const s: String; var theResult: Str15 );
  607. begin
  608. theResult := s;
  609. end;
  610. function StringToStr27( const s: String ) : Str27;
  611. begin
  612. result := s;
  613. end;
  614. procedure StringIntoStr27( const s: String; var theResult: Str27 );
  615. begin
  616. theResult := s;
  617. end;
  618. function StringToStr31( const s: String ) : Str31;
  619. begin
  620. result := s;
  621. end;
  622. procedure StringIntoStr31( const s: String; var theResult: Str31 );
  623. begin
  624. theResult := s;
  625. end;
  626. function StringToStr32( const s: String ) : Str32;
  627. begin
  628. result := s;
  629. end;
  630. procedure StringIntoStr32( const s: String; var theResult: Str32 );
  631. begin
  632. theResult := s;
  633. end;
  634. function StringToStr63( const s: String ) : Str63;
  635. begin
  636. result := s;
  637. end;
  638. procedure StringIntoStr63( const s: String; var theResult: Str63 );
  639. begin
  640. theResult := s;
  641. end;
  642. function StringToStr255( const s: String ) : Str255;
  643. begin
  644. result := s;
  645. end;
  646. procedure StringIntoStr255( const s: String; var theResult: Str255 );
  647. begin
  648. theResult := s;
  649. end;
  650. function Str15ToString( const s: Str15 ) : String15;
  651. begin
  652. result := s;
  653. end;
  654. function Str27ToString( const s: Str27 ) : String27;
  655. begin
  656. result := s;
  657. end;
  658. function Str31ToString( const s: Str31 ) : String31;
  659. begin
  660. result := s;
  661. end;
  662. function Str32ToString( const s: Str32 ) : String32;
  663. begin
  664. result := s;
  665. end;
  666. function Str63ToString( const s: Str63 ) : String63;
  667. begin
  668. result := s;
  669. end;
  670. function Str255ToString( const s: Str255 ) : String255;
  671. begin
  672. result := s;
  673. end;
  674. procedure InitStr15( var s: Str15);
  675. begin
  676. s := ''
  677. end;
  678. procedure InitStr27( var s: Str27);
  679. begin
  680. s := ''
  681. end;
  682. procedure InitStr31( var s: Str31);
  683. begin
  684. s := ''
  685. end;
  686. procedure InitStr32( var s: Str32);
  687. begin
  688. s := ''
  689. end;
  690. procedure InitStr63( var s: Str63);
  691. begin
  692. s := ''
  693. end;
  694. procedure InitStr255( var s: Str255);
  695. begin
  696. s := ''
  697. end;
  698. function CopyStr15( const theSource: Str15; theStart, theCount: Integer) : Str255;
  699. begin
  700. result := copy(theSource,theStart,theCount)
  701. end;
  702. function CopyStr27( const theSource: Str27; theStart, theCount: Integer) : Str255;
  703. begin
  704. result := copy(theSource,theStart,theCount)
  705. end;
  706. function CopyStr31( const theSource: Str31; theStart, theCount: Integer) : Str255;
  707. begin
  708. result := copy(theSource,theStart,theCount)
  709. end;
  710. function CopyStr32( const theSource: Str32; theStart, theCount: Integer) : Str255;
  711. begin
  712. result := copy(theSource,theStart,theCount)
  713. end;
  714. function CopyStr63( const theSource: Str63; theStart, theCount: Integer) : Str255;
  715. begin
  716. result := copy(theSource,theStart,theCount)
  717. end;
  718. function CopyStr255( const theSource: Str255; theStart, theCount: Integer) : Str255;
  719. begin
  720. result := copy(theSource,theStart,theCount)
  721. end;
  722. procedure DeleteStr15( var theDest: Str15; theStart, theCount: Integer);
  723. begin
  724. delete(theDest,theStart,theCount)
  725. end;
  726. procedure DeleteStr27( var theDest: Str27; theStart, theCount: Integer);
  727. begin
  728. delete(theDest,theStart,theCount)
  729. end;
  730. procedure DeleteStr31( var theDest: Str31; theStart, theCount: Integer);
  731. begin
  732. delete(theDest,theStart,theCount)
  733. end;
  734. procedure DeleteStr32( var theDest: Str32; theStart, theCount: Integer);
  735. begin
  736. delete(theDest,theStart,theCount)
  737. end;
  738. procedure DeleteStr63( var theDest: Str63; theStart, theCount: Integer);
  739. begin
  740. delete(theDest,theStart,theCount)
  741. end;
  742. procedure DeleteStr255( var theDest: Str255; theStart, theCount: Integer);
  743. begin
  744. delete(theDest,theStart,theCount)
  745. end;
  746. procedure InsertStr255( const theSource: Str255; var theDest: Str255; theStart: Integer);
  747. begin
  748. insert(theSource,theDest,theStart);
  749. end;
  750. function PosCharInStr15( theCh: Char; const theStr: Str15) : Integer;
  751. begin
  752. result := pos(theCh,theStr)
  753. end;
  754. function PosCharInStr27( theCh: Char; const theStr: Str27) : Integer;
  755. begin
  756. result := pos(theCh,theStr)
  757. end;
  758. function PosCharInStr31( theCh: Char; const theStr: Str31) : Integer;
  759. begin
  760. result := pos(theCh,theStr)
  761. end;
  762. function PosCharInStr32( theCh: Char; const theStr: Str32) : Integer;
  763. begin
  764. result := pos(theCh,theStr)
  765. end;
  766. function PosCharInStr63( theCh: Char; const theStr: Str63) : Integer;
  767. begin
  768. result := pos(theCh,theStr)
  769. end;
  770. function PosCharInStr255( theCh: Char; const theStr: Str255) : Integer;
  771. begin
  772. result := pos(theCh,theStr)
  773. end;
  774. function PosInStr255( const theSubStr, theSourceStr: Str255) : Integer;
  775. begin
  776. result := pos(theSubStr,theSourceStr);
  777. end;
  778. end.