Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The GeoBase library provides a suite of cross-platform text functions that are used in place of strcpy et al.

This allows the rest of the code to be unaware of any platform inconsistencies.

Classes

NameDescription
Geo::GeoFixedString

This is a simple string class template that always uses a fixed amount of memory for a single string.

Geo::GeoString

STL string replacement.

Geo::GeoStringView

STL string_view replacement.

Geo::GeoTokenList

A basic replacement for 'strtok'.

Geo::GeoTokenStream

A very simple utility class that wraps some common parsing functionality around a GeoTokenList.

Typedefs

NameDescription
GeoString< char > GeoFileString

String type used for file paths.

GeoStringView< char > GeoFileStringView

String type used for file paths.

GeoString< char > GeoNetworkString

String type used for networking.

GeoString< char > GeoSymbolString

String type used for internal symbol matching.

GeoString< char > GeoUIString

String type used for user interface and feedback.

GeoString< char > GeoUtf8FileString

String type used for file paths when ASCII is required (rare).

Functions

NameDescription
ArrayToString(const Geo::GeoArray< T > &, const C *)

Function to make a string by concatenating an array of elements using IGeoStream::operator<< to convert each element to a string and placing the given separator between each element.

CropWhitespace(GeoString< T > &)

Removes leading and trailing whitespace characters from the provided string.

GeoAToF(const char *)

Equivalent to atof.

GeoAToI(const char *)

Equivalent to atoi.

GeoSPrintf(char *, size_t, const char *, ...)

Equivalent to sprintf.

GeoStrCat(char *, size_t, const char *)

Equivalent to strcat.

GeoStrCmp(const char *, const char *)

Equivalent to strcmp.

GeoStrCpy(char *, size_t, const char *)

Equivalent to strcpy.

GeoStrICmp(const char *, const char *)

Equivalent to stricmp.

GeoStrLen(const char *)

Equivalent to strlen.

GeoStrLwr(char *)

Equivalent to strlwr.

GeoStrNCat(char *, size_t, const char *, size_t)

Equivalent to strncat.

GeoStrNCmp(const char *, const char *, size_t)

Equivalent to strncmp.

GeoStrNCpy(char *, size_t, const char *, size_t)

Equivalent to strncpy.

GeoStrToS16(const char *)

Simple interpretation of the strtoXXX family of functions, returning a Geo::s16.

GeoStrToS32(const char *)

Simple interpretation of the strtoXXX family of functions, returning a Geo::s32.

GeoStrToS64(const char *)

Simple interpretation of the strtoXXX family of functions, returning a Geo::s64.

GeoStrToU16(const char *)

Simple interpretation of the strtoXXX family of functions, returning a Geo::u16.

GeoStrToU32(const char *)

Simple interpretation of the strtoXXX family of functions, returning a Geo::u32.

GeoStrToU64(const char *)

Simple interpretation of the strtoXXX family of functions, returning a Geo::u64.

GeoVSCPrintf(const char *, va_list)

Equivalent to vscprintf.

GeoVSPrintf(char *, size_t, const char *, va_list)

Equivalent to vsprintf.

IsWhitespace(char)

Returns whether the given character is a whitespace character.

operator<(GeoStringView< T >, GeoStringView< T >)

Comparison (required to use strings as keys in a map).

SplitStringToFloats(const C *)

Function to parse incoming string into an array of floats.

SplitStringToIntegers(const C *)

Function to parse incoming string into an array of integers.


Anchor
a9bc52e925ab0a0b073526fddf7171241
a9bc52e925ab0a0b073526fddf7171241

Geo::GeoString<C> Geo::ArrayToString

...

public: Geo::GeoString< C > ArrayToString
(
    const Geo::GeoArray< T > & arr,
    const C * separator
)

...

Function to make a string by concatenating an array of elements using IGeoStream::operator<< to convert each element to a string and placing the given separator between each element.


Anchor
abfa32f3331f917005ce0502690d1b338
abfa32f3331f917005ce0502690d1b338

void GEO_CALL Geo::CropWhitespace

...

public: void GEO_CALL CropWhitespace
(
    GeoString< T > & str
)

...

Removes leading and trailing whitespace characters from the provided string.


Anchor
aa76b564a9561cbd6ce46b53bcbedd924
aa76b564a9561cbd6ce46b53bcbedd924

double GEO_CALL Geo::GeoAToF

...

public: double GEO_CALL GeoAToF
(
    const char * str
)

...

Equivalent to atof.


Anchor
a08c507df02dfb5a418bfef8221881b0b
a08c507df02dfb5a418bfef8221881b0b

int GEO_CALL Geo::GeoAToI

...

public: int GEO_CALL GeoAToI
(
    const char * str
)

...

Equivalent to atoi.


Anchor
aff97fcbf10d97bff5c127f1679c3b21a
aff97fcbf10d97bff5c127f1679c3b21a

int GEO_CALL Geo::GeoSPrintf

...

public: int GEO_CALL GeoSPrintf
(
    char * buffer,
    size_t numberOfElements,
    const char * format,
    ...
)

...

Equivalent to sprintf.


Anchor
a637279e8293fd14230b012ae7130c4a1
a637279e8293fd14230b012ae7130c4a1

int GEO_CALL Geo::GeoStrCat

...

public: int GEO_CALL GeoStrCat
(
    char * strDestination,
    size_t numberOfElements,
    const char * strSource
)

...

Equivalent to strcat.


Anchor
a33ccce742b8ffa828bf133d5313d4df7
a33ccce742b8ffa828bf133d5313d4df7

int GEO_CALL Geo::GeoStrCmp

...

public: int GEO_CALL GeoStrCmp
(
    const char * strA,
    const char * strB
)

...

Equivalent to strcmp.


Anchor
a774d151261fb41596509da205a12f81d
a774d151261fb41596509da205a12f81d

int GEO_CALL Geo::GeoStrCpy

...

public: int GEO_CALL GeoStrCpy
(
    char * strDestination,
    size_t numberOfElements,
    const char * strSource
)

...

Equivalent to strcpy.


Anchor
a41a98d857adaaa0bb7f76da8f0880781
a41a98d857adaaa0bb7f76da8f0880781

int GEO_CALL Geo::GeoStrICmp

...

public: int GEO_CALL GeoStrICmp
(
    const char * strA,
    const char * strB
)

...

Equivalent to stricmp.


Anchor
acdd2d32f33d0109ce0e62c8916edc50f
acdd2d32f33d0109ce0e62c8916edc50f

int GEO_CALL Geo::GeoStrLen

...

public: int GEO_CALL GeoStrLen
(
    const char * strSource
)

...

Equivalent to strlen.


Anchor
a3f4c2f104e94d6335eb823d73515897f
a3f4c2f104e94d6335eb823d73515897f

int GEO_CALL Geo::GeoStrLwr

...

public: int GEO_CALL GeoStrLwr
(
    char * strSrcDest
)

...

Equivalent to strlwr.


Anchor
a42c040c60b93148eed066c668f9a7939
a42c040c60b93148eed066c668f9a7939

int GEO_CALL Geo::GeoStrNCat

...

public: int GEO_CALL GeoStrNCat
(
    char * strDestination,
    size_t numberOfElements,
    const char * strSource,
    size_t count
)

...

Equivalent to strncat.


Anchor
aa808a8bb95216b34f98098f15b1c300f
aa808a8bb95216b34f98098f15b1c300f

int GEO_CALL Geo::GeoStrNCmp

...

public: int GEO_CALL GeoStrNCmp
(
    const char * strA,
    const char * strB,
    size_t count
)

...

Equivalent to strncmp.


Anchor
ad8b65b9f2c2930de987993e482d2708f
ad8b65b9f2c2930de987993e482d2708f

int GEO_CALL Geo::GeoStrNCpy

...

public: int GEO_CALL GeoStrNCpy
(
    char * strDestination,
    size_t numberOfElements,
    const char * strSource,
    size_t count
)

...

Equivalent to strncpy.


Anchor
afe29f2b845c0539477076fda187c43e4
afe29f2b845c0539477076fda187c43e4

s16 GEO_CALL Geo::GeoStrToS16

...

public: s16 GEO_CALL GeoStrToS16
(
    const char * str
)

...

Simple interpretation of the strtoXXX family of functions, returning a Geo::s16.


Anchor
a713a92ef2639835085282216779273b8
a713a92ef2639835085282216779273b8

s32 GEO_CALL Geo::GeoStrToS32

...

public: s32 GEO_CALL GeoStrToS32
(
    const char * str
)

...

Simple interpretation of the strtoXXX family of functions, returning a Geo::s32.


Anchor
a1a6b58c64927cd3b6d65f1b7c696f0bf
a1a6b58c64927cd3b6d65f1b7c696f0bf

s64 GEO_CALL Geo::GeoStrToS64

...

public: s64 GEO_CALL GeoStrToS64
(
    const char * str
)

...

Simple interpretation of the strtoXXX family of functions, returning a Geo::s64.


Anchor
a172d63c90ddb30874b8f6cff2430f4a9
a172d63c90ddb30874b8f6cff2430f4a9

u16 GEO_CALL Geo::GeoStrToU16

...

public: u16 GEO_CALL GeoStrToU16
(
    const char * str
)

...

Simple interpretation of the strtoXXX family of functions, returning a Geo::u16.


Anchor
ab6a87d96bdbc741babfe0bb1a7adf6a6
ab6a87d96bdbc741babfe0bb1a7adf6a6

u32 GEO_CALL Geo::GeoStrToU32

...

public: u32 GEO_CALL GeoStrToU32
(
    const char * str
)

...

Simple interpretation of the strtoXXX family of functions, returning a Geo::u32.


Anchor
a5fdc5d34c3f665f5279c89b4330d5719
a5fdc5d34c3f665f5279c89b4330d5719

u64 GEO_CALL Geo::GeoStrToU64

...

public: u64 GEO_CALL GeoStrToU64
(
    const char * str
)

...

Simple interpretation of the strtoXXX family of functions, returning a Geo::u64.


Anchor
a35c3655d61684f9edfc1fafa56ee18e6
a35c3655d61684f9edfc1fafa56ee18e6

int GEO_CALL Geo::GeoVSCPrintf

...

public: int GEO_CALL GeoVSCPrintf
(
    const char * format,
    va_list argptr
)

...

Equivalent to vscprintf.


Anchor
a57f4e41a3f620928c0495abda32fbc98
a57f4e41a3f620928c0495abda32fbc98

int GEO_CALL Geo::GeoVSPrintf

...

public: int GEO_CALL GeoVSPrintf
(
    char * buffer,
    size_t numberOfElements,
    const char * format,
    va_list argptr
)

...

Equivalent to vsprintf.


Anchor
a2fd106c34acb12c7b1a7895ef8d036d3
a2fd106c34acb12c7b1a7895ef8d036d3

bool Geo::IsWhitespace

...

public: bool IsWhitespace
(
    char elem
)

...

Returns whether the given character is a whitespace character.


Anchor
a2b003ead5628528a8a8c6d15c1758283
a2b003ead5628528a8a8c6d15c1758283

bool Geo::operator<

...

public: bool operator<
(
    GeoStringView< T > lhs,
    GeoStringView< T > rhs
)

...

Comparison (required to use strings as keys in a map).


Anchor
af9a67e6bd654a48b80c2626151261e9a
af9a67e6bd654a48b80c2626151261e9a

GeoArray<float> Geo::SplitStringToFloats

...

public: GeoArray< float > SplitStringToFloats
(
    const C * str
)

...

Function to parse incoming string into an array of floats.

The floats can be separated by any number of space characters, but no other characters should be present.

Parameters
[in]str

Source string.

Returns

Resulting floats.


Anchor
a4885da918e44d0107820054e77489ba6
a4885da918e44d0107820054e77489ba6

GeoArray<T> Geo::SplitStringToIntegers

...

public: GeoArray< T > SplitStringToIntegers
(
    const C * str
)

...

Function to parse incoming string into an array of integers.

The integers can be separated by any number of space characters, but no other characters should be present.

Parameters
[in]str

Source string.

Returns

Resulting integers.