Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::CStringUtils Namespace Reference

Utility functions for character strings. More...

Functions

Real toReal (const char *str, bool *is_ok=0)
 Converts the string str to a real number. If is_ok is not null, it is set to true if the conversion is correct, false otherwise.
Integer toInteger (const char *str, bool *is_ok=0)
 Converts the string str to an unsigned integer. If is_ok is not null, it is set to true if the conversion is correct, false otherwise.
int toInt (const char *str, bool *is_ok=0)
 Converts the string str to an integer If is_ok is not null, it is set to true if the conversion is correct, false otherwise.
bool isEqual (const char *s1, const char *s2)
 Returns true if s1 and s2 are identical, false otherwise.
bool isLess (const char *s1, const char *s2)
 Returns true if s1 is less than (alphabetical order) s2 , false otherwise.
Integer len (const char *s)
 Returns the length of the string s.
char * copyn (char *to, const char *from, Integer n)
 Copies the first n characters of from into to.
char * copy (char *to, const char *from)
 Copies from into to.
Int64 largeLength (const char *s)
 Returns the length of the string s.
char * copyn (char *to, const char *from, Int64 n)

Detailed Description

Utility functions for character strings.

Utility functions for strings.

Function Documentation

◆ copy()

char * Arcane::CStringUtils::copy ( char * to,
const char * from )

Copies from into to.

Definition at line 107 of file arcane/src/arcane/utils/CStringUtils.cc.

◆ copyn() [1/2]

char * Arcane::CStringUtils::copyn ( char * to,
const char * from,
Int64 n )

◆ copyn() [2/2]

char * Arcane::CStringUtils::copyn ( char * to,
const char * from,
Integer n )

Copies the first n characters of from into to.

Return values
to

Definition at line 101 of file arcane/src/arcane/utils/CStringUtils.cc.

◆ isEqual()

bool Arcane::CStringUtils::isEqual ( const char * s1,
const char * s2 )

Returns true if s1 and s2 are identical, false otherwise.

Returns true if s1 and s2 are identical, false otherwise.

Definition at line 61 of file arcane/src/arcane/utils/CStringUtils.cc.

Referenced by Arcane::String::operator==.

◆ isLess()

bool Arcane::CStringUtils::isLess ( const char * s1,
const char * s2 )

Returns true if s1 is less than (alphabetical order) s2 , false otherwise.

Returns true if s1 is less than (alphabetical order) s2, false otherwise.

Returns true if s1 is lexicographically less than s2, false otherwise.

Definition at line 78 of file arcane/src/arcane/utils/CStringUtils.cc.

◆ largeLength()

Int64 Arcane::CStringUtils::largeLength ( const char * s)

Returns the length of the string s.

Returns the length of the string s.

Definition at line 69 of file arccore/src/base/arccore/base/CStringUtils.cc.

◆ len()

Integer Arcane::CStringUtils::len ( const char * s)

Returns the length of the string s.

Returns the length of the string s.

Returns the length of the string s (in 32 bits).

Definition at line 89 of file arcane/src/arcane/utils/CStringUtils.cc.

References len().

Referenced by len().

◆ toInt()

int Arcane::CStringUtils::toInt ( const char * str,
bool * is_ok = 0 )

Converts the string str to an integer If is_ok is not null, it is set to true if the conversion is correct, false otherwise.

Returns
the value of str converted to an integer or 0 in case of error.

Definition at line 50 of file arcane/src/arcane/utils/CStringUtils.cc.

◆ toInteger()

Integer Arcane::CStringUtils::toInteger ( const char * str,
bool * is_ok = 0 )

Converts the string str to an unsigned integer. If is_ok is not null, it is set to true if the conversion is correct, false otherwise.

Returns
the value of str converted to an unsigned integer or 0 in case of error.

Definition at line 40 of file arcane/src/arcane/utils/CStringUtils.cc.

◆ toReal()

Real Arcane::CStringUtils::toReal ( const char * str,
bool * is_ok = 0 )

Converts the string str to a real number. If is_ok is not null, it is set to true if the conversion is correct, false otherwise.

Returns
the value of str converted to a real number or 0 in case of error.

Definition at line 30 of file arcane/src/arcane/utils/CStringUtils.cc.