theConfig 10.0
Loading...
Searching...
No Matches
LcConfigC.cs
Go to the documentation of this file.
1
9/* LABEL-INIT */
10
11using csmkkernel;
12
13/* LABEL-START */
14
15using System;
16using System.Reflection;
17using System.Runtime.InteropServices;
18using System.Runtime.CompilerServices;
19using System.Collections.Generic;
20using System.Threading;
21
22namespace cslcconfig {
23
27#if META_IS_OBJECT
28 public partial class LcConfigC
29#else
30 public partial class LcConfigC : MkObjectC
31#endif
32 {
33 private readonly static ConstructorInfo ctor = getCtor(typeof(LcConfigC));
34 private readonly static ThreadLocal<LcConfigC> MK_NULL = new ThreadLocal<LcConfigC>(() => {
35 return (LcConfigC) atomSelfNull(ctor);
36 });
37
38 public static LcConfigC LcConfigC_ObjNew (IntPtr hdl) {
39 return hdl != IntPtr.Zero ? (LcConfigC) atomObjNew(typeof(LcConfigC), ctor, hdl) : MK_NULL.Value;
40 }
41
42 private static LcConfigC LcConfigC_ObjCreate (IntPtr hdl) {
43 return hdl != IntPtr.Zero ? (LcConfigC) atomObjCreate(typeof(LcConfigC), ctor, hdl) : MK_NULL.Value;
44 }
45
46 private static IntPtr LcConfigC_SelfCreate (IntPtr mkrt, IntPtr obj, IntPtr env) {
47 return atomSelfCreate(ctor, obj, env);
48 }
49
50 private static void LcConfigC_SelfUnlink (IntPtr mkrt, IntPtr self, IntPtr env) {
51 atomSelfUnlink(self, env);
52 }
53
54 internal static void SetupThreadCFG (IntPtr mkrt) {
55 Lc.LcCsTypeUpdate(mkrt, LcCsTypeLookupE.CFG, LcConfigC_SelfCreate, LcConfigC_SelfUnlink);
56 }
57
58 #if !META_STATIC_OVERWRITE
59
60 static LcConfigC() {
61 // M0("LcConfigC");
62 LcConfig.Setup();
63 SetupThreadCFG(IntPtr.Zero);
64 }
65
66 #endif
67/* LABEL-END */
68
69 internal LcConfigC (IntPtr cfgP) : base(cfgP) {
70 }
71
72 } // END - class "LcConfigC"
73
74 // BEGIN-LcConfigC - created by 'cs_MqC.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
75
76 public partial class LcConfigC {
77
81
82 // doc-key: LcConfigC,LcConfigC-Class-Export,sc_
83
85 new public static LcConfigC HandleResolve (Int32 netHdl) {
86 IntPtr __retVal__L = Lc.LcConfigHandleResolve(IntPtr.Zero, netHdl);
87 return LcConfigC.LcConfigC_ObjNew(__retVal__L);
88 }
89
90 // doc-key: LcConfigC,LcConfigC-Class-Export,om_
91
92 // skip class-overload: HandleGet = LcConfigHandleGet → MkObjectHandleGet
93
95 // LcConfigC_Class_CS_API
96 }
97
98 public partial class LcConfigC {
99
103
104 // doc-key: LcConfigC,LcConfigC-Class-Introspection,oc_
105
107 new public LcConfigC Next () {
108 IntPtr __retVal__L = Lc.LcConfigNext(hdl);
109 return LcConfigC.LcConfigC_ObjNew(__retVal__L);
110 }
111
113 new public LcConfigC Prev () {
114 IntPtr __retVal__L = Lc.LcConfigPrev(hdl);
115 return LcConfigC.LcConfigC_ObjNew(__retVal__L);
116 }
117
118 // doc-key: LcConfigC,LcConfigC-Class-Introspection,sc_
119
121 new public static LcConfigC Instances () {
122 IntPtr __retVal__L = Lc.LcConfigInstances(IntPtr.Zero);
123 return LcConfigC.LcConfigC_ObjNew(__retVal__L);
124 }
125
127 // LcConfigC_Class_CS_API
128 }
129
130 public partial class LcConfigC {
131
135
136 // doc-key: LcConfigC,LcConfigC-Class-Misc,sc_
137
139 new public static LcConfigC GetNull () {
140 IntPtr __retVal__L = Lc.LcConfigGetNull();
141 return LcConfigC.LcConfigC_ObjNew(__retVal__L);
142 }
143
145 // LcConfigC_Class_CS_API
146 }
147
148 public partial class LcConfigC {
149
153
154 // doc-key: LcConfigC,LcConfigC-Error,om_
155
158 LcErrorTypeE __retVal__L = Lc.LcConfigErrorType(hdl);
159 return __retVal__L;
160 }
161
163 // LcConfigC_Error_CS_API
164 }
165
166 public partial class LcConfigC {
167
171
172 // doc-key: LcConfigC,LcConfigC-Get,om_
173
176 LcConfigFormatE __retVal__L = Lc.LcConfigGetDefaultFormat(hdl);
177 return __retVal__L;
178 }
179
181 public short GetFloatPrecision () {
182 Int16 __retVal__L = Lc.LcConfigGetFloatPrecision(hdl);
183 return __retVal__L;
184 }
185
187 public string GetIncludeDir () {
188 IntPtr __retVal__L = Lc.LcConfigGetIncludeDir(hdl);
189 return Marshal.PtrToStringAnsi(__retVal__L);
190 }
191
193 public bool GetOption (LcConfigOptionsEF option) {
194 bool __retVal__L = Lc.LcConfigGetOption(hdl, option);
195 return __retVal__L;
196 }
197
200 LcConfigOptionsEF __retVal__L = Lc.LcConfigGetOptions(hdl);
201 return __retVal__L;
202 }
203
205 public short GetTabWidth () {
206 Int16 __retVal__L = Lc.LcConfigGetTabWidth(hdl);
207 return __retVal__L;
208 }
209
211 // LcConfigC_Get_CS_API
212 }
213
214 public partial class LcConfigC {
215
219
220 // doc-key: LcConfigC,LcConfigC-Lookup,oc_
221
223 public LcSettingC Lookup (string path) {
224 IntPtr path_cstr = Marshal.StringToHGlobalAnsi(path);
225 IntPtr __retVal__L = Lc.LcConfigLookup(hdl, path_cstr);
226 Marshal.FreeHGlobal(path_cstr);
227 return LcSettingC.LcSettingC_ObjNew(__retVal__L);
228 }
229
230 // doc-key: LcConfigC,LcConfigC-Lookup,omo
231
233 public bool LookupBool (string path) {
234 bool value_out;
235 IntPtr path_cstr = Marshal.StringToHGlobalAnsi(path);
236 MkErrorE errVal = Lc.LcConfigLookupBool(hdl, path_cstr, out value_out);
237 Marshal.FreeHGlobal(path_cstr);
238 MkErrorC.Check(hdl, errVal);
239 return value_out;
240 }
241
243 public double LookupFloat (string path) {
244 Double value_out;
245 IntPtr path_cstr = Marshal.StringToHGlobalAnsi(path);
246 MkErrorE errVal = Lc.LcConfigLookupFloat(hdl, path_cstr, out value_out);
247 Marshal.FreeHGlobal(path_cstr);
248 MkErrorC.Check(hdl, errVal);
249 return value_out;
250 }
251
253 public int LookupInt (string path) {
254 Int32 value_out;
255 IntPtr path_cstr = Marshal.StringToHGlobalAnsi(path);
256 MkErrorE errVal = Lc.LcConfigLookupInt(hdl, path_cstr, out value_out);
257 Marshal.FreeHGlobal(path_cstr);
258 MkErrorC.Check(hdl, errVal);
259 return value_out;
260 }
261
263 public long LookupInt64 (string path) {
264 Int64 value_out;
265 IntPtr path_cstr = Marshal.StringToHGlobalAnsi(path);
266 MkErrorE errVal = Lc.LcConfigLookupInt64(hdl, path_cstr, out value_out);
267 Marshal.FreeHGlobal(path_cstr);
268 MkErrorC.Check(hdl, errVal);
269 return value_out;
270 }
271
273 public string LookupString (string path) {
274 IntPtr value_out;
275 IntPtr path_cstr = Marshal.StringToHGlobalAnsi(path);
276 MkErrorE errVal = Lc.LcConfigLookupString(hdl, path_cstr, out value_out);
277 Marshal.FreeHGlobal(path_cstr);
278 MkErrorC.Check(hdl, errVal);
279 return Marshal.PtrToStringAnsi(value_out);
280 }
281
283 // LcConfigC_Lookup_CS_API
284 }
285
286 public partial class LcConfigC {
287
291
292 // doc-key: LcConfigC,LcConfigC-Misc,oc_
293
296 IntPtr __retVal__L = Lc.LcConfigRootSetting(hdl);
297 return LcSettingC.LcSettingC_ObjNew(__retVal__L);
298 }
299
300 // doc-key: LcConfigC,LcConfigC-Misc,om_
301
303 public void Clear () {
304 Lc.LcConfigClear(hdl);
305 }
306
308 new public void Log (MkObjectC fmtobj = null, int debug = 0, [CallerMemberName]string callfunc = null, int lvl = 0) {
309 IntPtr fmtobj_hdl = MkObjectC.getOBJ_null_allow(fmtobj);
310 if (debug > (int)(MkRuntimeC.DebugGet())) {return;}
311 IntPtr callfunc_cstr = Marshal.StringToHGlobalAnsi(callfunc);
312 Lc.LcConfigLog(mkrt, hdl, fmtobj_hdl, debug, callfunc_cstr, lvl);
313 Marshal.FreeHGlobal(callfunc_cstr);
314 }
315
317 public void ReadFile (string filename) {
318 IntPtr filename_cstr = Marshal.StringToHGlobalAnsi(filename);
319 MkErrorE errVal = Lc.LcConfigReadFile(hdl, filename_cstr);
320 Marshal.FreeHGlobal(filename_cstr);
321 MkErrorC.Check(hdl, errVal);
322 }
323
325 public void ReadString (string str) {
326 IntPtr str_cstr = Marshal.StringToHGlobalAnsi(str);
327 MkErrorE errVal = Lc.LcConfigReadString(hdl, str_cstr);
328 Marshal.FreeHGlobal(str_cstr);
329 MkErrorC.Check(hdl, errVal);
330 }
331
333 public void WriteFile (string filename) {
334 IntPtr filename_cstr = Marshal.StringToHGlobalAnsi(filename);
335 MkErrorE errVal = Lc.LcConfigWriteFile(hdl, filename_cstr);
336 Marshal.FreeHGlobal(filename_cstr);
337 MkErrorC.Check(hdl, errVal);
338 }
339
340 // doc-key: LcConfigC,LcConfigC-Misc,omo
341
343 public string WriteString () {
344 IntPtr val_out;
345 MkErrorE errVal = Lc.LcConfigWriteString(mkrt, hdl, out val_out);
346 MkErrorC.Check(hdl, errVal);
347 return Marshal.PtrToStringAnsi(val_out);
348 }
349
351 // LcConfigC_Misc_CS_API
352 }
353
354 public partial class LcConfigC {
355
359
360 // doc-key: LcConfigC,LcConfigC-Set,om_
361
363 public void SetDefaultFormat (LcConfigFormatE format) {
364 Lc.LcConfigSetDefaultFormat(hdl, format);
365 }
366
368 public void SetFloatPrecision (short digits) {
369 Lc.LcConfigSetFloatPrecision(hdl, digits);
370 }
371
373 public void SetIncludeDir (string include_dir) {
374 IntPtr include_dir_cstr = Marshal.StringToHGlobalAnsi(include_dir);
375 Lc.LcConfigSetIncludeDir(hdl, include_dir_cstr);
376 Marshal.FreeHGlobal(include_dir_cstr);
377 }
378
380 public void SetIncludeFunc (LcConfigIncludeCCB fConfigIncludeData = null) {
381 LcConfigIncludeCallF fConfigIncludeCall = LcConfigIncludeCall;
382 IntPtr fConfigIncludeData_ptr = fConfigIncludeData == null ? IntPtr.Zero : (IntPtr)GCHandle.Alloc(new LcCall(mkrt,fConfigIncludeData));
383 if (fConfigIncludeData_ptr == IntPtr.Zero) fConfigIncludeCall = null;
384 MkErrorE errVal = Lc.LcConfigSetIncludeFunc(mkrt, hdl, fConfigIncludeCall, fConfigIncludeData_ptr, LcConfigIncludeFree);
385 MkErrorC.Check(hdl, errVal);
386 }
387
389 public void SetOption (LcConfigOptionsEF option, bool flag) {
390 Lc.LcConfigSetOption(hdl, option, flag);
391 }
392
394 public void SetOptions (LcConfigOptionsEF options) {
395 Lc.LcConfigSetOptions(hdl, options);
396 }
397
399 public void SetSettingDeleteFunc (LcSettingDeleteCCB fSettingDeleteData = null) {
400 LcSettingDeleteCallF fSettingDeleteCall = LcSettingDeleteCall;
401 IntPtr fSettingDeleteData_ptr = fSettingDeleteData == null ? IntPtr.Zero : (IntPtr)GCHandle.Alloc(new LcCall(mkrt,fSettingDeleteData));
402 if (fSettingDeleteData_ptr == IntPtr.Zero) fSettingDeleteCall = null;
403 MkErrorE errVal = Lc.LcConfigSetSettingDeleteFunc(mkrt, hdl, fSettingDeleteCall, fSettingDeleteData_ptr, LcSettingDeleteFree);
404 MkErrorC.Check(hdl, errVal);
405 }
406
408 public void SetTabWidth (short width) {
409 Lc.LcConfigSetTabWidth(hdl, width);
410 }
411
413 // LcConfigC_Set_CS_API
414 }
415
416 public partial class LcConfigC {
417
421
422 // doc-key: LcConfigC,LcConfigC-TOR,sCc
423
425 protected static IntPtr CTOR () {
426 IntPtr __retVal__L = Lc.LcConfigCreate();
427 if (__retVal__L == IntPtr.Zero) {
428 throw new MkInitError("LcConfigC.CTOR");
429 }
430 return (IntPtr)__retVal__L;
431 }
432
434 public LcConfigC() : this(CTOR()) {}
435
437 public static LcConfigC Create () {
438 IntPtr __retVal__L = Lc.LcConfigCreate();
439 if (__retVal__L == IntPtr.Zero) {
440 throw new MkInitError("LcConfigC.Create");
441 }
442 return LcConfigC.LcConfigC_ObjCreate(__retVal__L);
443 }
444
446 // LcConfigC_TOR_CS_API
447 }
448
449 // END-LcConfigC - created by 'cs_MqC.tcl -i NHI1_HOME/theConfig/c/gen/c_lcconfig.meta' - DO NOT change
450
451} // END - namespace "cslcconfig"
LcConfigC - the class known as lccfg or Config define the main-configuration-handle …
Definition LcConfigC.cs:416
delegate void LcConfigIncludeCCB(string incDir, string path, MkBufferListC ret)
implements the cslcconfig API object: public version from LcConfigIncludeF as method
delegate void LcSettingDeleteCCB(long cfsH)
static LcConfigC LcConfigC_ObjNew(IntPtr hdl)
Definition LcConfigC.cs:38
LcSettingC - the class known as lccfs or Setting define a single config-setting …
static LcSettingC LcSettingC_ObjNew(IntPtr hdl)
Definition LcSettingC.cs:38
static void Check(IntPtr ctx, MkErrorE err)
static object atomObjNew(Type type, ConstructorInfo ctor, IntPtr obj)
static IntPtr getOBJ_null_allow(MkObjectC obj)
static object atomObjCreate(Type type, ConstructorInfo ctor, IntPtr obj)
static void atomSelfUnlink(IntPtr self, IntPtr env)
static object atomSelfNull(ConstructorInfo ctor)
static ConstructorInfo getCtor(Type type)
static IntPtr atomSelfCreate(ConstructorInfo ctor, IntPtr obj, IntPtr env)
enum MkErrorE(* LcSettingDeleteCallF)(LcSettingDeleteCallF_ARGS)
enum MkErrorE(* LcConfigIncludeCallF)(LcConfigIncludeCallF_ARGS)
new static LcConfigC Instances()
C#: [static] LcConfigC LcConfigC.Instances() → C-API get head-instance from linked-list of LcCon...
Definition LcConfigC.cs:121
new static LcConfigC GetNull()
C#: [static] LcConfigC LcConfigC.GetNull() → C-API Null-Slot - return a LcConfigC typed NULL ins...
Definition LcConfigC.cs:139
new LcConfigC Prev()
C#: LcConfigC cfg.Prev() → C-API get previous instance from linked-list of LcConfigS type
Definition LcConfigC.cs:113
new LcConfigC Next()
C#: LcConfigC cfg.Next() → C-API get next instance from linked-list of LcConfigS type
Definition LcConfigC.cs:107
new static LcConfigC HandleResolve(Int32 netHdl)
C#: [static] LcConfigC LcConfigC.HandleResolve(Int32 netHdl) → C-API Handle-Resolve-Slot - retur...
Definition LcConfigC.cs:85
LcErrorTypeE ErrorType()
C#: LcErrorTypeE config.ErrorType() → C-API This function, which is implemented as a macro,...
Definition LcConfigC.cs:157
short GetTabWidth()
C#: short config.GetTabWidth() → C-API These functions, which are implemented as macros,...
Definition LcConfigC.cs:205
LcConfigFormatE GetDefaultFormat()
C#: LcConfigFormatE config.GetDefaultFormat() → C-API These functions, which are implemented as...
Definition LcConfigC.cs:175
string GetIncludeDir()
C#: string config.GetIncludeDir() → C-API ConfigSetIncludeDir specifies the include directory,...
Definition LcConfigC.cs:187
bool GetOption(LcConfigOptionsEF option)
C#: bool config.GetOption(LcConfigOptionsEF option) → C-API Since v1.7 These functions get and ...
Definition LcConfigC.cs:193
short GetFloatPrecision()
C#: short config.GetFloatPrecision() → C-API Since v1.6 These functions get and set the number ...
Definition LcConfigC.cs:181
LcConfigOptionsEF GetOptions()
C#: LcConfigOptionsEF config.GetOptions() → C-API These functions get and set the options for t...
Definition LcConfigC.cs:199
double LookupFloat(string path)
C#: double config.LookupFloat(string path) → C-API These functions look up the value of the set...
Definition LcConfigC.cs:243
int LookupInt(string path)
C#: int config.LookupInt(string path) → C-API These functions look up the value of the setting ...
Definition LcConfigC.cs:253
LcSettingC Lookup(string path)
C#: LcSettingC config.Lookup(string path) → C-API This function locates the setting in the conf...
Definition LcConfigC.cs:223
long LookupInt64(string path)
C#: long config.LookupInt64(string path) → C-API These functions look up the value of the setti...
Definition LcConfigC.cs:263
string LookupString(string path)
C#: string config.LookupString(string path) → C-API These functions look up the value of the se...
Definition LcConfigC.cs:273
bool LookupBool(string path)
C#: bool config.LookupBool(string path) → C-API These functions look up the value of the settin...
Definition LcConfigC.cs:233
void ReadFile(string filename)
C#: config.ReadFile(string filename) → C-API This function reads and parses a configuration fro...
Definition LcConfigC.cs:317
void WriteFile(string filename)
C#: config.WriteFile(string filename) → C-API This function writes the configuration config to ...
Definition LcConfigC.cs:333
LcSettingC RootSetting()
C#: LcSettingC config.RootSetting() → C-API This function, which is implemented as a macro,...
Definition LcConfigC.cs:295
new void Log(MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0)
C#: cfg.Log(MkObjectC fmtobj = null, int debug = 0, [CallerMemberName]string callfunc = null,...
Definition LcConfigC.cs:308
void ReadString(string str)
C#: config.ReadString(string str) → C-API This function reads and parses a configuration from t...
Definition LcConfigC.cs:325
string WriteString()
C#: string cfg.WriteString() → C-API read the entire configuration cfg into the string val_out ...
Definition LcConfigC.cs:343
void Clear()
C#: config.Clear() → C-API Since v1.7 This function clears the configuration config …
Definition LcConfigC.cs:303
void SetDefaultFormat(LcConfigFormatE format)
C#: config.SetDefaultFormat(LcConfigFormatE format) → C-API These functions,...
Definition LcConfigC.cs:363
void SetSettingDeleteFunc(LcSettingDeleteCCB fSettingDeleteData=null)
C#: cfg.SetSettingDeleteFunc(LcSettingDeleteCCB fSettingDeleteData = null) → C-API set the call...
Definition LcConfigC.cs:399
void SetOptions(LcConfigOptionsEF options)
C#: config.SetOptions(LcConfigOptionsEF options) → C-API These functions get and set the option...
Definition LcConfigC.cs:394
void SetFloatPrecision(short digits)
C#: config.SetFloatPrecision(short digits) → C-API Since v1.6 These functions get and set the n...
Definition LcConfigC.cs:368
void SetIncludeFunc(LcConfigIncludeCCB fConfigIncludeData=null)
C#: cfg.SetIncludeFunc(LcConfigIncludeCCB fConfigIncludeData = null) → C-API set the __parser__...
Definition LcConfigC.cs:380
void SetIncludeDir(string include_dir)
C#: config.SetIncludeDir(string include_dir) → C-API ConfigSetIncludeDir specifies the include ...
Definition LcConfigC.cs:373
void SetOption(LcConfigOptionsEF option, bool flag)
C#: config.SetOption(LcConfigOptionsEF option, bool flag) → C-API Since v1.7 These functions ge...
Definition LcConfigC.cs:389
void SetTabWidth(short width)
C#: config.SetTabWidth(short width) → C-API These functions, which are implemented as macros,...
Definition LcConfigC.cs:408
static IntPtr CTOR()
C#: [constructor,static] LcConfigC LcConfigC.Create() → C-API create a LcConfigC instance …
Definition LcConfigC.cs:425
LcConfigC()
CONSTRUCTOR.
Definition LcConfigC.cs:434
static LcConfigC Create()
C#: [constructor,static] LcConfigC LcConfigC.Create() → C-API create a LcConfigC instance …
Definition LcConfigC.cs:437
#define MK_NULL
MkErrorE
LcConfigOptionsEF
→ C-API: LcConfigOptionsEF → C-API: LcConfigOptionsEF
LcErrorTypeE
→ C-API: LcErrorTypeE → C-API: LcErrorTypeE
LcConfigFormatE
→ C-API: LcConfigFormatE → C-API: LcConfigFormatE