Gocator API
 All Classes Files Functions Variables Typedefs Macros Groups Pages
GoUtils.h
Go to the documentation of this file.
1 /**
2  * @file GoUtils.h
3  * @brief Contains various helper functions.
4  *
5  * @internal
6  * Copyright (C) 2011-2012 by LMI Technologies Inc.
7  * Licensed under the MIT License.
8  * Redistributed files must retain the above copyright notice.
9  */
10 #ifndef GO_API_UTILS_H
11 #define GO_API_UTILS_H
12 
13 #include <GoSdk/GoSdkDef.h>
14 #include <math.h>
16 
17 /**
18  * Returns true if input is within min and max.
19  */
20 #define GoUtils_MinMax_(in, min, max) \
21  (((in) > (max) || (in) < (min)) ? (kFALSE) : (kTRUE))
22 
23 GoFx(kStatus) GoOptionList_ParseList32u(const kChar* text, kArrayList list);
24 GoFx(kStatus) GoOptionList_Parse32u(const kChar* text, k32u* optionList, kSize capacity, kSize* count);
25 GoFx(kStatus) GoOptionList_ParseHelper32u(const kChar* text, kSize length, k32u* value);
26 GoFx(kStatus) GoOptionList_Format32u(const k32u* optionList, kSize count, kChar* text, kSize capacity);
27 GoFx(kStatus) GoOptionList_Check32u(const k32u* optionList, kSize count, k32u value);
28 
29 GoFx(kStatus) GoOptionList_ParseList64f(const kChar* text, kArrayList list);
30 GoFx(kStatus) GoOptionList_Parse64f(const kChar* text, k64f* optionList, kSize capacity, kSize* count);
31 GoFx(kStatus) GoOptionList_ParseHelper64f(const kChar* text, kSize length, k64f* value);
32 GoFx(kStatus) GoOptionList_Format64f(const k64f* optionList, kSize count, kChar* text, kSize capacity);
33 GoFx(kStatus) GoOptionList_Check64f(const k64f* optionList, kSize count, k64f value);
34 
35 
36 /**
37  * Returns the result of a floating point number equivalence, based on a given degree of precision.
38  *
39  * @public @memberof GoUtils
40  * @param first k64f object.
41  * @param second k64f object.
42  * @param decimalPrecision k8u object.
43  * @return Returns kTRUE if the numbers are equivalent within the given precision; KFALSE otherwise.
44  */
45 GoFx(kBool) GoUtils_FuzzyEquivalence(k64f first, k64f second, k8u decimalPrecision);
46 
47 GoFx(kStatus) GoConfig_WriteRangeElement64f(kXml xml, kXmlItem item, const kChar* elementName, GoElement64f element);
48 GoFx(kStatus) GoConfig_WriteRangeElement32u(kXml xml, kXmlItem item, const kChar* elementName, GoElementUInt32 element);
49 GoFx(kStatus) GoConfig_ReadRangeElement64f(kXml xml, kXmlItem item, const kChar* elementName, GoElement64f* element);
50 GoFx(kStatus) GoConfig_ReadRangeElementUInt32(kXml xml, kXmlItem item, const kChar* elementName, GoElementUInt32* element);
51 
52 kEndHeader()
53 #include <GoSdk/GoUtils.x.h>
54 
55 #endif
kBeginHeader() kStatus GoOptionList_ParseList32u(const kChar *text
Returns true if input is within min and max.
Essential API declarations.