Mercurial > projects > dstep
comparison dstep/coreservices/carboncore/TextUtils.d @ 11:07194b026fa4
Added bindings to a couple of frameworks, new license + some other things
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 01 Aug 2009 15:03:28 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
10:27e00625790b | 11:07194b026fa4 |
---|---|
1 /** | |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Jul 21, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.coreservices.carboncore.TextUtils; | |
8 | |
9 //import dstep.AvailabilityMacros; | |
10 import dstep.coreservices.carboncore.DateTimeUtils; | |
11 import dstep.coreservices.carboncore.IntlResources; | |
12 import dstep.coreservices.carboncore.MacTypes; | |
13 import dstep.coreservices.carboncore.NumberFormatting; | |
14 import dstep.coreservices.carboncore.StringCompare; | |
15 import dstep.internal.Types; | |
16 import dstep.internal.Version; | |
17 | |
18 extern (C) | |
19 { | |
20 int Munger (Handle h, int offset, void* ptr1, int len1, void* ptr2, int len2); | |
21 } | |
22 | |
23 static if (!D_LP64) | |
24 { | |
25 struct ScriptRunStatus | |
26 { | |
27 byte script; | |
28 byte runVariant; | |
29 } | |
30 | |
31 struct BreakTable | |
32 { | |
33 char[256] charTypes; | |
34 short tripleLength; | |
35 short[1] triples; | |
36 } | |
37 | |
38 alias BreakTable* BreakTablePtr; | |
39 | |
40 struct NBreakTable | |
41 { | |
42 byte flags1; | |
43 byte flags2; | |
44 short version_; | |
45 short classTableOff; | |
46 short auxCTableOff; | |
47 short backwdTableOff; | |
48 short forwdTableOff; | |
49 short doBackup; | |
50 short length; | |
51 char[256] charTypes; | |
52 short[1] tables; | |
53 } | |
54 | |
55 alias NBreakTable* NBreakTablePtr; | |
56 | |
57 extern (C) | |
58 { | |
59 StringHandle NewString (ConstStr255Param theString); | |
60 void SetString (StringHandle theString, ConstStr255Param); | |
61 StringHandle GetString (short stringID); | |
62 void GetIndString (Str255 theString, short strListID, short itemIndex); | |
63 void FindWordBreaks (Ptr textPtr, short textLength, short offset, bool leadingEdge, BreakTablePtr breaks, OffsetTable offsets, ScriptCode script); | |
64 void LowercaseText (Ptr textPtr, short len, ScriptCode script); | |
65 void UppercaseText (Ptr textPtr, short len, ScriptCode script); | |
66 void StripDiacritics (Ptr textPtr, short len, ScriptCode script); | |
67 void UppercaseStripDiacritics (Ptr textPtr, short len, ScriptCode script); | |
68 ScriptRunStatus FindScriptRun (Ptr textPtr, c_long textLen, c_long lenUsed); | |
69 void UpperString (Str255 theString, bool diacSensitive); | |
70 void upperstring (char* theString, bool diacSensitive); | |
71 void c2pstrcpy (Str255 dst, /*const*/ char* src); | |
72 void p2cstrcpy (char* dst, ConstStr255Param src); | |
73 void CopyPascalStringToC (ConstStr255Param src, char* dst); | |
74 void CopyCStringToPascal (/*const*/ char* src, Str255 dst); | |
75 StringPtr c2pstr (char* aStr); | |
76 StringPtr C2PStr (Ptr cString); | |
77 char* p2cstr (StringPtr aStr); | |
78 Ptr P2CStr (StringPtr pString); | |
79 } | |
80 } | |
81 | |
82 extern (C): | |
83 c_long Munger (Handle h, c_long offset, /*const*/ void* ptr1, c_long len1, /*const*/ void* ptr2, c_long len2); |