Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_OS_String Class Reference

This class includes functions available in string.h and ctype.h. More...

#include <OS_String.h>

Inheritance diagram for ACE_OS_String:

Inheritance graph
[legend]
List of all members.

Static Public Methods

Functions from <cstring>
Included are the functions defined in <cstring> and their <cwchar> equivalents.

Todo:
To be complete, we should add strcoll, and strxfrm.


const void * memchr (const void *s, int c, size_t len)
 Finds characters in a buffer (const void version). More...

void * memchr (void *s, int c, size_t len)
 Finds characters in a buffer (void version). More...

int memcmp (const void *t, const void *s, size_t len)
 Compares two buffers. More...

void * memcpy (void *t, const void *s, size_t len)
 Copies one buffer to another. More...

void * memmove (void *t, const void *s, size_t len)
 Moves one buffer to another. More...

void * memset (void *s, int c, size_t len)
 Fills a buffer with a character value. More...

char * strcat (char *s, const char *t)
 Appends a string to another string (char version). More...

wchar_t * strcat (wchar_t *s, const wchar_t *t)
 Appends a string to another string (wchar_t version). More...

const char * strchr (const char *s, int c)
 Finds the first occurance of a character in a string (const char version). More...

const wchar_t * strchr (const wchar_t *s, wint_t c)
 Finds the first occurance of a character in a string (const wchar_t version). More...

char * strchr (char *s, int c)
 Finds the first occurance of a character in a string (char version). More...

wchar_t * strchr (wchar_t *s, wint_t c)
 Finds the first occurance of a character in a string (wchar_t version). More...

int strcmp (const char *s, const char *t)
 Compares two strings (char version). More...

int strcmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t)
 Compares two strings (wchar_t version). More...

char * strcpy (char *s, const char *t)
 Copies a string (char version). More...

wchar_t * strcpy (wchar_t *s, const wchar_t *t)
 Copies a string (wchar_t version). More...

size_t strcspn (const char *s, const char *reject)
 Searches for the first substring without any of the specified characters and returns the size of the substring (char version). More...

size_t strcspn (const wchar_t *s, const wchar_t *reject)
 Searches for the first substring without any of the specified characters and returns the size of the substring (wchar_t version). More...

char * strerror (int errnum)
 Returns a system error message. More...

size_t strlen (const char *s)
 Finds the length of a string (char version). More...

size_t strlen (const ACE_WCHAR_T *s)
 Finds the length of a string (ACE_WCHAR_T version). More...

size_t strnlen (const char *s, size_t maxlen)
 Finds the length of a limited-length string (char version). More...

size_t strnlen (const ACE_WCHAR_T *s, size_t maxlen)
 Finds the length of a limited-length string (ACE_WCHAR_T version). More...

char * strncat (char *s, const char *t, size_t len)
 Appends part of a string to another string (char version). More...

ACE_WCHAR_T * strncat (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len)
 Appends part of a string to another string (wchar_t version). More...

int strncmp (const char *s, const char *t, size_t len)
 Compares two arrays (char version). More...

int strncmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len)
 Compares two arrays (wchar_t version). More...

char * strncpy (char *s, const char *t, size_t len)
 Copies an array (char version). More...

ACE_WCHAR_T * strncpy (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len)
 Copies an array (ACE_WCHAR_T version). More...

const char * strpbrk (const char *s1, const char *s2)
 Searches for characters in a string (const char version). More...

const wchar_t * strpbrk (const wchar_t *s1, const wchar_t *s2)
 Searches for characters in a string (const wchar_t version). More...

char * strpbrk (char *s1, const char *s2)
 Searches for characters in a string (char version). More...

wchar_t * strpbrk (wchar_t *s1, const wchar_t *s2)
 Searches for characters in a string (wchar_t version). More...

const char * strrchr (const char *s, int c)
 Finds the last occurance of a character in a string (const char version). More...

const wchar_t * strrchr (const wchar_t *s, wint_t c)
 Finds the last occurance of a character in a string (const wchar_t version). More...

char * strrchr (char *s, int c)
 Finds the last occurance of a character in a string (char version). More...

wchar_t * strrchr (wchar_t *s, wint_t c)
 Finds the last occurance of a character in a string (wchar_t version). More...

size_t strspn (const char *s1, const char *s2)
 Searches for the first substring containing only the specified characters and returns the size of the substring (char version). More...

size_t strspn (const wchar_t *s1, const wchar_t *s2)
 Searches for the first substring containing only the specified characters and returns the size of the substring (wchar_t version). More...

const char * strstr (const char *s, const char *t)
 Finds the first occurance of a substring in a string (const char version). More...

const wchar_t * strstr (const wchar_t *s, const wchar_t *t)
 Finds the first occurance of a substring in a string (const wchar_t version). More...

char * strstr (char *s, const char *t)
 Finds the first occurance of a substring in a string (char version). More...

wchar_t * strstr (wchar_t *s, const wchar_t *t)
 Finds the first occurance of a substring in a string (wchar_t version). More...

char * strtok (char *s, const char *tokens)
 Finds the next token in a string (char version). More...

wchar_t * strtok (wchar_t *s, const wchar_t *tokens)
 Finds the next token in a string (wchar_t version). More...

Functions from <cctype>
Included are the functions defined in <cctype> and their <cwctype> equivalents.

Since they are often implemented as macros, we don't use the same name here. Instead, we change by prepending "ace_" (with the exception of to_lower).

Todo:
To be complete, we should add: isalnum, isalpha, iscntrl isdigit, isgraph, islower, ispunct, isupper, isxdigit, and toupper.


int ace_isprint (const ACE_TCHAR c)
 Returns true if the character is a printable character. More...

int ace_isspace (const ACE_TCHAR c)
 Returns true if the character is a space character. More...

int to_lower (int c)
 Converts a character to lower case (char version). More...

wint_t to_lower (wint_t c)
 Converts a character to lower case (wchar_t version). More...

Non-standard functions
These functions aren't in the standard.

char * itoa (int value, char *string, int radix)
 Converts an integer to a string. More...

wchar_t * itoa (int value, wchar_t *string, int radix)
 Converts an integer to a string. More...

int strcasecmp (const char *s, const char *t)
 Compares two strings (case insensitive const char version). More...

int strcasecmp (const wchar_t *s, const wchar_t *t)
 Compares two strings (case insensitive const wchar_t version). More...

const char * strnchr (const char *s, int c, size_t len)
 Finds the first occurance of a character in an array (const char version). More...

const ACE_WCHAR_T * strnchr (const ACE_WCHAR_T *s, ACE_WINT_T c, size_t len)
 Finds the first occurance of a character in an array (const ACE_WCHAR_T version). More...

char * strnchr (char *s, int c, size_t len)
 Finds the first occurance of a character in an array (char version). More...

ACE_WCHAR_T * strnchr (ACE_WCHAR_T *s, ACE_WINT_T c, size_t len)
 Finds the first occurance of a character in an array (ACE_WCHAR_T version). More...

int strncasecmp (const char *s, const char *t, size_t len)
 Compares two arrays (case insensitive const char version). More...

int strncasecmp (const wchar_t *s, const wchar_t *t, size_t len)
 Compares two arrays (case insensitive const wchar_t version). More...

char * strecpy (char *des, const char *src)
 Copies a string, but returns a pointer to the end of the copied region (char version). More...

wchar_t * strecpy (wchar_t *s, const wchar_t *t)
 Copies a string, but returns a pointer to the end of the copied region (wchar_t version). More...

char * strsncpy (char *dst, const char *src, size_t maxlen)
 This is a "safe" c string copy function (char version). More...

ACE_WCHAR_T * strsncpy (ACE_WCHAR_T *dst, const ACE_WCHAR_T *src, size_t maxlen)
 This is a "safe" c string copy function (wchar_t version). More...

const char * strnstr (const char *s, const char *t, size_t len)
 Finds the first occurance of a substring in an array (const char version). More...

const ACE_WCHAR_T * strnstr (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len)
 Finds the first occurance of a substring in an array (const wchar_t version). More...

char * strnstr (char *s, const char *t, size_t len)
 Finds the first occurance of a substring in an array (char version). More...

ACE_WCHAR_T * strnstr (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len)
 Finds the first occurance of a substring in an array (wchar_t version). More...

char * strdup (const char *s)
 Returns a malloced duplicated string (char version). More...

wchar_t * strdup (const wchar_t *s)
 Returns a malloced duplicated string (wchar_t version). More...

char * strtok_r (char *s, const char *tokens, char **lasts)
 Finds the next token in a string (safe char version). More...

wchar_t * strtok_r (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts)
 Finds the next token in a string (wchar_t version). More...

double strtod (const char *s, char **endptr)
 Converts a string to a double value (char version). More...

double strtod (const wchar_t *s, wchar_t **endptr)
 Converts a string to a double value (wchar_t version). More...

long strtol (const char *s, char **ptr, int base)
 Converts a string to a long value (char version). More...

long strtol (const wchar_t *s, wchar_t **ptr, int base)
 Converts a string to a long value (wchar_t version). More...

unsigned long strtoul (const char *s, char **ptr, int base)
 Converts a string to an unsigned long value (char version). More...

unsigned long strtoul (const wchar_t *s, wchar_t **ptr, int base)
 Converts a string to an unsigned long value (wchar_t version). More...


Static Private Methods

Emulation
These methods are provided for platforms that do not have a native implementation.

char * itoa_emulation (int value, char *string, int radix)
 Emulated itoa - Converts an integer to a string. More...

wchar_t * itow_emulation (int value, wchar_t *string, int radix)
 Emulated itow - Converts an integer to a string. More...

const void * memchr_emulation (const void *s, int c, size_t len)
 Emulated memchr - Finds a character in a buffer. More...

int strcasecmp_emulation (const char *s, const char *t)
 Emulated strcasecmp - Performs a case insensitive comparison of strings. More...

int strncasecmp_emulation (const char *s, const char *t, size_t len)
 Emulated strncasecmp - Performs a case insensitvie comparison of arrays. More...

size_t strcspn_emulation (const char *s, const char *reject)
 Emulated strcspn - Finds a substring in a string. More...

char * strchr_emulation (char *s, int c)
 Emulated strchr (char version) - Finds the first occurance of a character in a string. More...

const char * strchr_emulation (const char *s, int c)
 Emulated strchr (const char version) - Finds the first occurance of a character in a string. More...

char * strrchr_emulation (char *s, int c)
 Emulated strrchr (char version) - Finds the last occurance of a character in a string. More...

const char * strrchr_emulation (const char *s, int c)
 Emulated strrchr (const char version) - Finds the last occurance of a character in a string. More...

char * strtok_r_emulation (char *s, const char *tokens, char **lasts)
 Emulated strtok_r. More...

wchar_t * strtok_r_emulation (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts)
 Emulated strtok_r (wchar_t version). More...

wchar_t * wcscat_emulation (wchar_t *destination, const wchar_t *source)
 Emulated wcscat - Appends a string. More...

wchar_t * wcschr_emulation (const wchar_t *string, wint_t c)
 Emulated wcschr - Finds a character in a string. More...

int wcscmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2)
 Emulated wcscmp - Compares strings. More...

wchar_t * wcscpy_emulation (wchar_t *destination, const wchar_t *source)
 Emulated wcscpy - Copies a string. More...

int wcsicmp_emulation (const wchar_t *string1, const wchar_t *string2)
 Emulated wcsicmp - Performs a case insensitive comparison of strings. More...

size_t wcslen_emulation (const ACE_WCHAR_T *string)
 Emulated wcslen - Returns the length of a string. More...

ACE_WCHAR_T * wcsncat_emulation (ACE_WCHAR_T *destination, const ACE_WCHAR_T *source, size_t count)
 Emulated wcscat - Appends a string. More...

int wcsncmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2, size_t len)
 Emulated wcsncmp - Compares two arrays. More...

ACE_WCHAR_T * wcsncpy_emulation (ACE_WCHAR_T *destination, const ACE_WCHAR_T *source, size_t len)
 Emulated wcsncpy - Copies an array. More...

int wcsnicmp_emulation (const wchar_t *string1, const wchar_t *string2, size_t len)
 Emulated wcsnicmp - Performs a case insensitive comparison of two arrays. More...

wchar_t * wcspbrk_emulation (const wchar_t *string, const wchar_t *charset)
 Emulated wcspbrk - Searches for characters in a string. More...

wchar_t * wcsrchr_emulation (wchar_t *string, wint_t c)
 Emulated wcsrchr (wchar_t version) - Finds the last occurance of a character in a string. More...

const wchar_t * wcsrchr_emulation (const wchar_t *string, wint_t c)
 Emulated wcsrchr (const wchar_t version) - Finds the last occurance of a character in a string. More...

size_t wcscspn_emulation (const wchar_t *string, const wchar_t *reject)
 Emulated wcscspn. More...

size_t wcsspn_emulation (const wchar_t *string, const wchar_t *charset)
 Emulated wcsspn. More...

wchar_t * wcsstr_emulation (const wchar_t *string, const wchar_t *charset)
 Emulated wcsstr - Performs a case insensitive comparison of two strings. More...


Detailed Description

This class includes functions available in string.h and ctype.h.

Definition at line 43 of file OS_String.h.


Member Function Documentation

ACE_INLINE int ACE_OS_String::ace_isprint const ACE_TCHAR    c [static]
 

Returns true if the character is a printable character.

Definition at line 459 of file OS_String.inl.

References ACE_TCHAR.

Referenced by ACE::format_hexdump.

00460 {
00461 #if defined (ACE_USES_WCHAR)
00462   return iswprint (c);
00463 #else /* ACE_USES_WCHAR */
00464   return isprint ((unsigned char) c);
00465 #endif /* ACE_USES_WCHAR */
00466 }

ACE_INLINE int ACE_OS_String::ace_isspace const ACE_TCHAR    c [static]
 

Returns true if the character is a space character.

Definition at line 469 of file OS_String.inl.

References ACE_TCHAR.

Referenced by ACE_Base64::decode, ACE_Base64::length, ACE_Ini_ImpExp::squish, and ACE_OS::string_to_argv.

00470 {
00471 #if defined (ACE_USES_WCHAR)
00472   return iswspace (c);
00473 #else /* ACE_USES_WCHAR */
00474   return isspace ((unsigned char) c);
00475 #endif /* ACE_USES_WCHAR */
00476 }

wchar_t* ACE_OS_String::itoa int    value,
wchar_t *    string,
int    radix
[static]
 

Converts an integer to a string.

ACE_INLINE char * ACE_OS_String::itoa int    value,
char *    string,
int    radix
[static]
 

Converts an integer to a string.

Definition at line 493 of file OS_String.inl.

References itoa_emulation.

00494 {
00495 #if !defined (ACE_HAS_ITOA)
00496   return ACE_OS_String::itoa_emulation (value, string, radix);
00497 #elif defined (ACE_ITOA_EQUIVALENT)
00498   return ACE_ITOA_EQUIVALENT (value, string, radix);
00499 #else /* !ACE_HAS_ITOA */
00500   return ::itoa (value, string, radix);
00501 #endif /* !ACE_HAS_ITOA */
00502 }

char * ACE_OS_String::itoa_emulation int    value,
char *    string,
int    radix
[static, private]
 

Emulated itoa - Converts an integer to a string.

Definition at line 473 of file OS_String.cpp.

Referenced by itoa.

00474 {
00475   char *e = string;
00476   char *b = string;
00477 
00478   // Short circuit if 0
00479 
00480   if (value == 0)
00481     {
00482       string[0] = '0';
00483       string[1] = 0;
00484       return string;
00485     }
00486 
00487   // If negative and base 10, print a - and then do the
00488   // number.
00489 
00490   if (value < 0 && radix == 10)
00491     {
00492       string[0] = '-';
00493       ++b;
00494       ++e; // Don't overwrite the negative sign.
00495       value = -value; // Drop negative sign so character selection is correct.
00496     }
00497 
00498   // Convert to base <radix>, but in reverse order
00499 
00500   while (value != 0)
00501     {
00502       int mod = value % radix;
00503       value = value / radix;
00504 
00505       *e++ = (mod < 10) ? '0' + mod : 'a' + mod - 10;
00506     }
00507 
00508   *e-- = 0;
00509 
00510   // Now reverse the string to get the correct result
00511 
00512   while (e > b)
00513     {
00514       char temp = *e;
00515       *e = *b;
00516       *b = temp;
00517       ++b;
00518       --e;
00519     }
00520 
00521   return string;
00522 }

wchar_t * ACE_OS_String::itow_emulation int    value,
wchar_t *    string,
int    radix
[static, private]
 

Emulated itow - Converts an integer to a string.

Definition at line 527 of file OS_String.cpp.

00528 {
00529   wchar_t *e = string;
00530   wchar_t *b = string;
00531 
00532   // Short circuit if 0
00533 
00534   if (value == 0)
00535     {
00536       string[0] = '0';
00537       string[1] = 0;
00538       return string;
00539     }
00540 
00541   // If negative and base 10, print a - and then do the
00542   // number.
00543 
00544   if (value < 0 && radix == 10)
00545     {
00546       string[0] = '-';
00547       b++;
00548     }
00549 
00550   // Convert to base <radix>, but in reverse order
00551 
00552   while (value != 0)
00553     {
00554       int mod = value % radix;
00555       value = value / radix;
00556 
00557       *e++ = (mod < 10) ? '0' + mod : 'a' + mod - 10;
00558     }
00559 
00560   *e-- = 0;
00561 
00562   // Now reverse the string to get the correct result
00563 
00564   while (e > b)
00565   {
00566     wchar_t temp = *e;
00567     *e = *b;
00568     *b = temp;
00569     ++b;
00570     --e;
00571   }
00572 
00573   return string;
00574 }

ACE_INLINE void * ACE_OS_String::memchr void *    s,
int    c,
size_t    len
[static]
 

Finds characters in a buffer (void version).

Definition at line 46 of file OS_String.inl.

References memchr.

00047 {
00048   return ACE_const_cast (void *,
00049     ACE_OS_String::memchr (ACE_static_cast (const void *, s), c, len));
00050 }

ACE_INLINE const void * ACE_OS_String::memchr const void *    s,
int    c,
size_t    len
[static]
 

Finds characters in a buffer (const void version).

Definition at line 36 of file OS_String.inl.

References memchr_emulation.

Referenced by memchr.

00037 {
00038 #if defined (ACE_HAS_MEMCHR)
00039   return ::memchr (s, c, len);
00040 #else /* ACE_HAS_MEMCHR */
00041   return ACE_OS_String::memchr_emulation (s, c, len);
00042 #endif /* ACE_HAS_MEMCHR */
00043 }

const void * ACE_OS_String::memchr_emulation const void *    s,
int    c,
size_t    len
[static, private]
 

Emulated memchr - Finds a character in a buffer.

Definition at line 456 of file OS_String.cpp.

Referenced by memchr.

00457 {
00458   const unsigned char *t = (const unsigned char *) s;
00459   const unsigned char *e = (const unsigned char *) s + len;
00460 
00461   while (t < e)
00462     if (((int) *t) == c)
00463       return t;
00464     else
00465       t++;
00466 
00467   return 0;
00468 }

ACE_INLINE int ACE_OS_String::memcmp const void *    t,
const void *    s,
size_t    len
[static]
 

Compares two buffers.

Definition at line 54 of file OS_String.inl.

Referenced by ACE_String_Base::compare, ACE_INET_Addr::get_host_name_i, ACE_CDR::LongDouble::operator!=, ACE_NS_String::operator==, ACE_INET_Addr::operator==, ACE_CDR::LongDouble::operator==, ACE_ATM_Addr::operator==, and strnstr.

00055 {
00056   return ::memcmp (t, s, len);
00057 }

ACE_INLINE void * ACE_OS_String::memcpy void *    t,
const void *    s,
size_t    len
[static]
 

Copies one buffer to another.

Definition at line 61 of file OS_String.inl.

Referenced by ACE_TLI_Acceptor::accept, ACE_ATM_QoS::ACE_ATM_QoS, ACE_Handle_Set::ACE_Handle_Set, ACE_Message_Block::ACE_Message_Block, ACE_Name_Request::ACE_Name_Request, ACE_NS_String::ACE_NS_String, ACE_SString::ACE_SString, ACE_ATM_Addr::addr_to_string, ACE_Data_Block::clone, ACE_InputCDR::clone_from, ACE_TLI_Connector::connect, ACE_ATM_QoS::construct_options, ACE_Obstack_T::copy, ACE_Message_Block::copy, ACE_ARGV::create_buf_from_queue, ACE_Active_Map_Manager_Key::decode, ACE_Active_Map_Manager_Key::encode, ACE_Sock_Connect::get_bcast_addr, ACE_Configuration_Heap::get_binary_value, ACE_INET_Addr::get_host_name_i, ACE_INET_Addr::get_ip_address, ACE_ATM_Acceptor::get_local_addr, ACE_TLI::get_option, ACE_ATM_Stream::get_vpi_vci, ACE_OS::gethrtime, ACE_Timer_Heap_T::grow_heap, ACE_OS::inet_pton, ACE_ATM_Addr::init, ACE_Codeset_Registry::locale_to_registry_i, ACE_OS::lwp_getparams, ACE_SOCK_Dgram_Bcast::mk_broadcast, ACE_Name_Request::name, ACE_String_Base::operator+=, ACE_DEV_Addr::operator=, ACE_OS::putmsg, ACE_InputCDR::read_array, ACE_UPIPE_Stream::recv, ACE_SOCK_Dgram::recv, ACE_MEM_IO::recv, ACE_Codeset_Registry::registry_to_locale_i, ACE_Obstack_T::request, ACE_OS_Dirent::scandir_emulation, ACE_OS::sema_init, ACE_SOCK_Dgram::send, ACE_MEM_IO::send, ACE_UNIX_Addr::set, ACE_String_Base::set, ACE_SPIPE_Addr::set, ACE_INET_Addr::set, ACE_DEV_Addr::set, ACE_ATM_Addr::set, ACE_UNIX_Addr::set_addr, ACE_SPIPE_Addr::set_addr, ACE_ATM_Addr::set_addr, ACE_INET_Addr::set_address, ACE_Configuration_Heap::set_binary_value, ACE_TLI::set_option, ACE_OS::set_scheduling_params, ACE_Process_Options::setenv_i, ACE_Data_Block::size, ACE_ATM_Addr::string_to_addr, ACE_Name_Request::value, and ACE_OutputCDR::write_array.

00062 {
00063   return ::memcpy (t, s, len);
00064 }

ACE_INLINE void * ACE_OS_String::memmove void *    t,
const void *    s,
size_t    len
[static]
 

Moves one buffer to another.

Definition at line 67 of file OS_String.inl.

Referenced by ACE_Message_Block::crunch.

00068 {
00069   return ::memmove (t, s, len);
00070 }

ACE_INLINE void * ACE_OS_String::memset void *    s,
int    c,
size_t    len
[static]
 

Fills a buffer with a character value.

Definition at line 73 of file OS_String.inl.

Referenced by ACE_ATM_Addr::ACE_ATM_Addr, ACE_ATM_QoS::ACE_ATM_QoS, ACE_DEV_Addr::ACE_DEV_Addr, ACE_INET_Addr::ACE_INET_Addr, ACE_Mem_Map::ACE_Mem_Map, ACE_Process::ACE_Process, ACE_Process_Options::ACE_Process_Options, ACE_Profile_Timer::ACE_Profile_Timer, ACE_SPIPE_Addr::ACE_SPIPE_Addr, ACE_Token_Request::ACE_Token_Request, ACE_UNIX_Addr::ACE_UNIX_Addr, ACE_Dynamic_Cached_Allocator::calloc, ACE_Cached_Allocator::calloc, ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::calloc, ACE_Static_Allocator_Base::calloc, ACE_New_Allocator::calloc, ACE_Sock_Connect::count_interfaces, ACE_Thread::disablecancel, ACE_OS::fork_exec, ACE_Sock_Connect::get_bcast_addr, ACE_Sock_Connect::get_ip_interfaces, ACE_ATM_Stream::get_peer_name, ACE_ATM_Stream::get_vpi_vci, ACE_OS::getcwd, ACE_Filecache_Object::init, ACE_ATM_Addr::init, ACE_Log_Msg::log, ACE_OS::lwp_getparams, ACE_ATM_Stream::open, ACE_ATM_Acceptor::open, ACE_Sched_Params::priority_max, ACE_Sched_Params::priority_min, ACE_INET_Addr::reset, ACE_String_Base::resize, ACE_OS::scheduling_class, ACE_TTY_IO::Serial_Params::Serial_Params, ACE_UNIX_Addr::set, ACE_SPIPE_Addr::set, ACE_INET_Addr::set, ACE_DEV_Addr::set, ACE_ATM_QoS::set_cbr_rate, ACE::set_handle_limit, ACE_OS::set_scheduling_params, ACE_SOCK_Acceptor::shared_open, ACE_OS::thr_create, and ACE_OS::thr_setprio.

00074 {
00075   return ::memset (s, c, len);
00076 }

int ACE_OS_String::strcasecmp const wchar_t *    s,
const wchar_t *    t
[static]
 

Compares two strings (case insensitive const wchar_t version).

ACE_INLINE int ACE_OS_String::strcasecmp const char *    s,
const char *    t
[static]
 

Compares two strings (case insensitive const char version).

Definition at line 517 of file OS_String.inl.

References strcasecmp_emulation.

Referenced by ACE_POSIX_Proactor::ACE_POSIX_Proactor, ACE_TTY_IO::control, ACE_Lib_Find::ldfind, and ACE_Name_Options::parse_args.

00518 {
00519 #if defined (ACE_LACKS_STRCASECMP)
00520   return ACE_OS_String::strcasecmp_emulation (s, t);
00521 #elif defined (ACE_STRCASECMP_EQUIVALENT)
00522   return ACE_STRCASECMP_EQUIVALENT (s, t);
00523 #else /* ACE_LACKS_STRCASECMP */
00524   return ::strcasecmp (s, t);
00525 #endif /* ACE_LACKS_STRCASECMP */
00526 }

int ACE_OS_String::strcasecmp_emulation const char *    s,
const char *    t
[static, private]
 

Emulated strcasecmp - Performs a case insensitive comparison of strings.

Definition at line 276 of file OS_String.cpp.

References to_lower.

Referenced by strcasecmp.

00277 {
00278   const char *scan1 = s;
00279   const char *scan2 = t;
00280 
00281   while (*scan1 != 0
00282          && ACE_OS_String::to_lower (*scan1)
00283             == ACE_OS_String::to_lower (*scan2))
00284     {
00285       ++scan1;
00286       ++scan2;
00287     }
00288 
00289   // The following case analysis is necessary so that characters which
00290   // look negative collate low against normal characters but high
00291   // against the end-of-string NUL.
00292 
00293   if (*scan1 == '\0' && *scan2 == '\0')
00294     return 0;
00295   else if (*scan1 == '\0')
00296     return -1;
00297   else if (*scan2 == '\0')
00298     return 1;
00299   else
00300     return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
00301 }

wchar_t* ACE_OS_String::strcat wchar_t *    s,
const wchar_t *    t
[static]
 

Appends a string to another string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strcat char *    s,
const char *    t
[static]
 

Appends a string to another string (char version).

Definition at line 79 of file OS_String.inl.

Referenced by ACE_MEM_Acceptor::accept, ACE_ARGV::ACE_ARGV, ACE_Logging_Strategy::ACE_Logging_Strategy, ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool, ACE_Name_Options::ACE_Name_Options, ACE_System_Time::ACE_System_Time, ACE_Process_Options::command_line, ACE_Local_Name_Space::create_manager_i, ACE_Sock_Connect::get_ip_interfaces, ACE_OS::getcwd, ACE_Log_Msg::inherit_hook, ACE_MT_MEM_IO::init, ACE_Lib_Find::ldfind, ACE_Lib_Find::ldname, ACE_Service_Manager::list_services, ACE_DLL_Handle::open, ACE_OS_Dirent::opendir_emulation, ACE_OS::sema_init, ACE_SPIPE_Addr::set, ACE_FILE_Addr::set, and ACE_OS::uname.

00080 {
00081   return ::strcat (s, t);
00082 }

wchar_t* ACE_OS_String::strchr wchar_t *    s,
wint_t    c
[static]
 

Finds the first occurance of a character in a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strchr char *    s,
int    c
[static]
 

Finds the first occurance of a character in a string (char version).

Definition at line 119 of file OS_String.inl.

References strchr_emulation.

00120 {
00121 #if defined (ACE_LACKS_STRCHR)
00122   return ACE_OS_String::strchr_emulation (s, c);
00123 #else  /* ! ACE_LACKS_STRCHR */
00124   return ::strchr (s, c);
00125 #endif /* ACE_LACKS_STRCHR */
00126 }

const wchar_t* ACE_OS_String::strchr const wchar_t *    s,
wint_t    c
[static]
 

Finds the first occurance of a character in a string (const wchar_t version).

ACE_INLINE const char * ACE_OS_String::strchr const char *    s,
int    c
[static]
 

Finds the first occurance of a character in a string (const char version).

Definition at line 97 of file OS_String.inl.

References strchr_emulation.

Referenced by ACE_SDM_helpers::addr_to_string, ACE_SString::find, ACE_Service_Manager::handle_input, ACE_Ini_ImpExp::import_config, ACE_Registry_ImpExp::import_config, ACE_Get_Opt::long_option, ACE_Configuration_Heap::open_section, ACE_Registry_ImpExp::process_previous_line_format, ACE_SPIPE_Addr::set, and ACE_Get_Opt::short_option_i.

00098 {
00099 #if defined (ACE_LACKS_STRCHR)
00100   return ACE_OS_String::strchr_emulation (s, c);
00101 #else  /* ! ACE_LACKS_STRCHR */
00102   return (const char *) ::strchr (s, c);
00103 #endif /* ACE_LACKS_STRCHR */
00104 }

const char * ACE_OS_String::strchr_emulation const char *    s,
int    c
[static, private]
 

Emulated strchr (const char version) - Finds the first occurance of a character in a string.

Definition at line 134 of file OS_String.cpp.

00135 {
00136   for (;;++s)
00137     {
00138       if (*s == c)
00139         return s;
00140       if (*s == 0)
00141         return 0;
00142     }
00143 }

char * ACE_OS_String::strchr_emulation char *    s,
int    c
[static, private]
 

Emulated strchr (char version) - Finds the first occurance of a character in a string.

Definition at line 122 of file OS_String.cpp.

Referenced by strchr.

00123 {
00124   for (;;++s)
00125     {
00126       if (*s == c)
00127         return s;
00128       if (*s == 0)
00129         return 0;
00130     }
00131 }

ACE_INLINE int ACE_OS_String::strcmp const ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    t
[static]
 

Compares two strings (wchar_t version).

Definition at line 144 of file OS_String.inl.

References ACE_WCHAR_T, and wcscmp_emulation.

00145 {
00146 #  if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSCMP)
00147   return ACE_OS_String::wcscmp_emulation (s, t);
00148 #  else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */
00149   return ::wcscmp (s, t);
00150 #  endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */
00151 }

ACE_INLINE int ACE_OS_String::strcmp const char *    s,
const char *    t
[static]
 

Compares two strings (char version).

Definition at line 138 of file OS_String.inl.

Referenced by ace_get_module, ACE_Malloc_FIFO_Iterator_T::advance, ACE_Malloc_LIFO_Iterator_T::advance, ACE_SString::compare, ACE_Predefined_Naming_Contexts::connect, ACE_SOCK_Dgram_Mcast::dump, ACE_Stream::find, ACE_Stream_Type::find, ACE_DLL_Manager::find_dll, ACE_Service_Repository::find_i, ACE_Sock_Connect::get_ip_interfaces, ACE_OS::inet_aton, ACE_Stream::insert, ACE_Service_Repository::insert, ACE_Capabilities::is_entry, ACE_Predefined_Naming_Contexts::is_local_host, ACE_Lib_Find::ldfind, ACE_Local_Name_Space::list_type_entries_i, ACE_Local_Name_Space::list_types_i, ACE_Naming_Context::local, ACE_Codeset_Registry::locale_to_registry_i, ACE_DLL_Handle::open, ACE_Service_Config::open_i, ACE_DLL::open_i, ACE_Configuration_ExtId::operator!=, ACE_SString::operator<, ACE_SString::operator==, ACE_SPIPE_Addr::operator==, ACE_Static_Svc_Descriptor::operator==, ACE_Name_Binding::operator==, ACE_FILE_Addr::operator==, ACE_DEV_Addr::operator==, ACE_Configuration_ExtId::operator==, ACE_SString::operator>, ACE_RW_Token::owners, ACE_Name_Options::parse_args, ACE_Get_Opt::permute, ACE_Logging_Strategy::priorities, ACE_Service_Manager::process_request, ACE_Stream::remove, ACE_Framework_Repository::remove_component, ACE_Framework_Repository::remove_dll_components_i, ACE_Stream::replace, ACE_INET_Addr::set, ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::shared_find, ACE_ATM_Addr::string_to_addr, ACE_Static_Function_Node::symbol, ACE_OS::thr_equal, ACE_Logging_Strategy::tokenize, and ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::unbind.

00139 {
00140   return ::strcmp (s, t);
00141 }

wchar_t* ACE_OS_String::strcpy wchar_t *    s,
const wchar_t *    t
[static]
 

Copies a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strcpy char *    s,
const char *    t
[static]
 

Copies a string (char version).

Definition at line 154 of file OS_String.inl.

Referenced by ACE_ARGV::ACE_ARGV, ACE_Filecache_Object::ACE_Filecache_Object, ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool, ACE_PI_Control_Block::ACE_Name_Node::ACE_Name_Node, ACE_Control_Block::ACE_Name_Node::ACE_Name_Node, ACE_SString::ACE_SString, ACE_System_Time::ACE_System_Time, ACE_Configuration_Heap::add_section, ACE_SDM_helpers::addr_to_string, ACE_ATM_Addr::addr_to_string, ACE_Process_Options::command_line, ACE_Local_Name_Space::create_manager_i, ACE_OS::cuserid, ACE_OS::dlsym, ACE_SOCK_Dgram_Mcast::dump, ACE::execname, ACE_INET_Addr::get_host_name, ACE_INET_Addr::get_host_name_i, ACE_ATM_Stream::get_peer_name, get_reg_subkeys, ACE_Lib_Find::get_temp_dir, ACE_OS::getcwd, ACE_OS::inet_ntop, ACE_MT_MEM_IO::init, ACE_Lib_Find::ldfind, ACE_Lib_Find::ldname, ACE_Service_Manager::list_services, ACE_Log_Msg::log, ACE_SOCK_Dgram_Mcast::make_multicast_ifaddr, ACE_OS::mkdir, ACE_Configuration_Heap::new_section, ACE_DLL_Strategy::open, ACE_SOCK_Dgram_Mcast::open_i, ACE_OS_Dirent::opendir_emulation, ACE_SString::operator=, ACE_Sched_Params::priority_max, ACE_Sched_Params::priority_min, ACE_Process_Options::process_name, ACE_InputCDR::read_string, ACE_OS_Dirent::readdir_emulation, ACE_Remote_Name_Space::resolve, ACE_OS_Dirent::scandir_emulation, ACE_OS::scheduling_class, ACE_OS::sema_init, ACE_UNIX_Addr::set, ACE_SPIPE_Addr::set, ACE_FILE_Addr::set, ACE_Configuration_Heap::set_binary_value, ACE_Configuration_Heap::set_integer_value, ACE_SOCK_Dgram::set_nic, ACE_Configuration_Heap::set_string_value, ACE_Local_Name_Space::shared_bind_i, strdup, ACE::strnew, ACE_OS::uname, and ACE_Process_Options::working_directory.

00155 {
00156   return ::strcpy (s, t);
00157 }

size_t ACE_OS_String::strcspn const wchar_t *    s,
const wchar_t *    reject
[static]
 

Searches for the first substring without any of the specified characters and returns the size of the substring (wchar_t version).

ACE_INLINE size_t ACE_OS_String::strcspn const char *    s,
const char *    reject
[static]
 

Searches for the first substring without any of the specified characters and returns the size of the substring (char version).

Definition at line 172 of file OS_String.inl.

References strcspn_emulation.

Referenced by ACE_Configuration::validate_name.

00173 {
00174 #if defined (ACE_LACKS_STRCSPN)
00175   return ACE_OS_String::strcspn_emulation (s, reject);
00176 #else  /* ACE_LACKS_STRCSPN */
00177   return ::strcspn (s, reject);
00178 #endif /* ACE_LACKS_STRCSPN */
00179 }

size_t ACE_OS_String::strcspn_emulation const char *    s,
const char *    reject
[static, private]
 

Emulated strcspn - Finds a substring in a string.

Definition at line 254 of file OS_String.cpp.

Referenced by strcspn.

00255 {
00256   const char *scan;
00257   const char *rej_scan;
00258   int count = 0;
00259 
00260   for (scan = s; *scan; scan++)
00261     {
00262 
00263       for (rej_scan = reject; *rej_scan; rej_scan++)
00264         if (*scan == *rej_scan)
00265           return count;
00266 
00267       count++;
00268     }
00269 
00270   return count;
00271 }

wchar_t * ACE_OS_String::strdup const wchar_t *    s [static]
 

Returns a malloced duplicated string (wchar_t version).

Definition at line 87 of file OS_String.cpp.

References ACE_OS_Memory::malloc, strcpy, and strlen.

00088 {
00089 #   if defined (ACE_LACKS_WCSDUP)
00090   wchar_t *buffer =
00091     (wchar_t *) ACE_OS_Memory::malloc ((ACE_OS_String::strlen (s) + 1)
00092                                        * sizeof (wchar_t));
00093   if (buffer == 0)
00094     return 0;
00095 
00096   return ACE_OS_String::strcpy (buffer, s);
00097 #   elif defined (ACE_WCSDUP_EQUIVALENT)
00098   return ACE_WCSDUP_EQUIVALENT (s);
00099 #   else /* ACE_LACKS_WCSDUP */
00100 #     if defined (__MINGW32__)
00101   return ::wcsdup (ACE_const_cast(wchar_t*, s));
00102 #     else /* __MINGW32__ */
00103   return ::wcsdup (s);
00104 #     endif /* __MINGW32__ */
00105 #   endif /* ACE_LACKS_WCSDUP */
00106 }

char * ACE_OS_String::strdup const char *    s [static]
 

Returns a malloced duplicated string (char version).

Definition at line 72 of file OS_String.cpp.

References ACE_OS_Memory::malloc, strcpy, and strlen.

Referenced by ACE_Argv_Type_Converter::ACE_Argv_Type_Converter, ACE_Condition::ACE_Condition, ACE_Configuration_Section_Key_Heap::ACE_Configuration_Section_Key_Heap, ACE_Mutex::ACE_Mutex, ACE_Name_Options::ACE_Name_Options, ACE_STATIC_SVC_DEFINE, ACE_Strategy_Acceptor::ACE_Strategy_Acceptor, ACE_Name_Options::database, ACE_OS::flock_init, ACE_Thru_Task::info, ACE_Stream_Tail::info, ACE_Stream_Head::info, ACE_Stream_Type::info, ACE_Module_Type::info, ACE_Service_Manager::info, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info, ACE_Oneshot_Acceptor::info, ACE_Strategy_Acceptor::info, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info, ACE_Lib_Find::ldfind, ACE_Local_Name_Space::list_type_entries_i, ACE_Local_Name_Space::list_types_i, ACE_Log_Msg::local_host, ACE_Name_Options::nameserver_host, ACE_Name_Options::namespace_dir, ACE_TLI_Acceptor::open, ACE_Log_Msg::open, ACE_Strategy_Acceptor::open, ACE_Name_Binding::operator=, ACE_Name_Options::process_name, ACE_OS::sema_init, ACE_SPIPE_Addr::set, ACE_OS::strenvdup, ACE_INET_Addr::string_to_addr, ACE_OS::string_to_argv, and ACE_Log_Msg::sync.

00073 {
00074 #if defined (ACE_HAS_STRDUP_EMULATION)
00075   char *t = (char *) ACE_OS_Memory::malloc (ACE_OS_String::strlen (s) + 1);
00076   if (t == 0)
00077     return 0;
00078 
00079   return ACE_OS_String::strcpy (t, s);
00080 #else
00081   return ::strdup (s);
00082 #endif /* ACE_HAS_STRDUP_EMULATION */
00083 }

wchar_t * ACE_OS_String::strecpy wchar_t *    s,
const wchar_t *    t
[static]
 

Copies a string, but returns a pointer to the end of the copied region (wchar_t version).

Definition at line 240 of file OS_String.cpp.

References ACE_TEXT_WIDE.

00241 {
00242   register wchar_t *dscan = s;
00243   register const wchar_t *sscan = t;
00244 
00245   while ((*dscan++ = *sscan++) != ACE_TEXT_WIDE ('\0'))
00246     continue;
00247 
00248   return dscan;
00249 }

char * ACE_OS_String::strecpy char *    des,
const char *    src
[static]
 

Copies a string, but returns a pointer to the end of the copied region (char version).

Definition at line 227 of file OS_String.cpp.

Referenced by ACE_ARGV::ACE_ARGV, ACE_OS::argv_to_string, and ACE::execname.

00228 {
00229   register char *dscan = s;
00230   register const char *sscan = t;
00231 
00232   while ((*dscan++ = *sscan++) != '\0')
00233     continue;
00234 
00235   return dscan;
00236 }

ACE_INLINE char * ACE_OS_String::strerror int    errnum [static]
 

Returns a system error message.

Definition at line 194 of file OS_String.inl.

References strerror.

Referenced by ACE_POSIX_AIOCB_Proactor::delete_result_aiocb_list, ACE_OS::dlerror, and ACE_Log_Msg::log.

00195 {
00196 #if defined (ACE_LACKS_STRERROR)
00197   return ACE_OS_String::strerror_emulation (errnum);
00198 #else /* ACE_LACKS_STRERROR */
00199   return ::strerror (errnum);
00200 #endif /* ACE_LACKS_STRERROR */
00201 }

ACE_INLINE size_t ACE_OS_String::strlen const ACE_WCHAR_T *    s [static]
 

Finds the length of a string (ACE_WCHAR_T version).

Definition at line 210 of file OS_String.inl.

References ACE_WCHAR_T, and wcslen_emulation.

00211 {
00212 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSLEN)
00213   return ACE_OS_String::wcslen_emulation (s);
00214 # else  /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */
00215   return ::wcslen (s);
00216 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */
00217 }

ACE_INLINE size_t ACE_OS_String::strlen const char *    s [static]
 

Finds the length of a string (char version).

Definition at line 204 of file OS_String.inl.

Referenced by ACE_MEM_Acceptor::accept, ACE_ARGV::ACE_ARGV, ACE_NS_WString::ACE_NS_WString, ACE_SString::ACE_SString, ACE_STATIC_SVC_DEFINE, ACE_String_Base::ACE_String_Base, ACE_ARGV::add, ACE_Configuration_Heap::add_section, ACE_INET_Addr::addr_to_string, ACE_ATM_Addr::addr_to_string, ACE_OS::argv_to_string, ACE_Remote_Name_Space::bind, ACE_Message_Block::copy, ACE_ARGV::create_buf_from_queue, ACE_Local_Name_Space::create_manager_i, ACE_Arg_Shifter::cur_arg_strncasecmp, ACE_OS::cuserid, ACE_Token_Request::decode, ACE_OS::dlsym, ACE::execname, ACE_String_Base::find, ACE_INET_Addr::get_host_name_i, ACE_ATM_Stream::get_peer_name, ACE_Lib_Find::get_temp_dir, ACE_OS::getcwd, ACE_Logging_Strategy::handle_timeout, ACE::hash_pjw, ACE_Ini_ImpExp::import_config, ACE_Registry_ImpExp::import_config, ACE_OS::inet_ntop, ACE_Thru_Task::info, ACE_Stream_Tail::info, ACE_Stream_Head::info, ACE_Stream_Type::info, ACE_Module_Type::info, ACE_Service_Manager::info, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info, ACE_Oneshot_Acceptor::info, ACE_Strategy_Acceptor::info, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info, ACE_Process_Options::inherit_environment, ACE_Lib_Find::ldfind, ACE_Lib_Find::ldname, ACE_Service_Manager::list_services, ACE_Log_Msg::log, ACE_Log_Msg::log_hexdump, ACE_Get_Opt::long_option_i, ACE_Registry::make_name, ACE_OS::mkdir, ACE_Log_Record::msg_data_len, ACE_Configuration_Heap::open, ACE_SOCK_Dgram_Mcast::open_i, ACE_OS_Dirent::opendir_emulation, operator<<, operator>>, ACE_Log_Record::print, ACE_High_Res_Timer::print_ave, ACE_High_Res_Timer::print_total, ACE_OS_Dirent::readdir_emulation, ACE_Remote_Name_Space::rebind, ACE_SString::rep, ACE_Local_Name_Space::resolve_i, ACE_Log_Record::round_up, ACE_OS_Dirent::scandir_emulation, ACE_UNIX_Addr::set, ACE_String_Base::set, ACE_SPIPE_Addr::set, ACE_FILE_Addr::set, ACE_DEV_Addr::set, ACE_Configuration_Heap::set_binary_value, ACE_Configuration_Heap::set_integer_value, ACE_Configuration_Heap::set_string_value, ACE_Process_Options::setenv, ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::shared_bind, ACE_Local_Name_Space::shared_bind_i, ACE_Process::spawn, ACE_Ini_ImpExp::squish, strdup, ACE_INET_Addr::string_to_addr, ACE::strnew, strnstr, strrchr_emulation, ACE_Lib_Find::strsplit_r, strtok_r_emulation, wcsrchr_emulation, wcsstr_emulation, and ACE_OutputCDR::write_string.

00205 {
00206   return ::strlen (s);
00207 }

int ACE_OS_String::strncasecmp const wchar_t *    s,
const wchar_t *    t,
size_t    len
[static]
 

Compares two arrays (case insensitive const wchar_t version).

ACE_INLINE int ACE_OS_String::strncasecmp const char *    s,
const char *    t,
size_t    len
[static]
 

Compares two arrays (case insensitive const char version).

Definition at line 561 of file OS_String.inl.

References strncasecmp_emulation.

Referenced by ACE_Arg_Shifter::cur_arg_strncasecmp.

00562 {
00563 #if defined (ACE_LACKS_STRCASECMP)
00564   return ACE_OS_String::strncasecmp_emulation (s, t, len);
00565 #elif defined (ACE_STRNCASECMP_EQUIVALENT)
00566   return ACE_STRNCASECMP_EQUIVALENT (s, t, len);
00567 #else /* ACE_LACKS_STRCASECMP */
00568   return ::strncasecmp (s, t, len);
00569 #endif /* ACE_LACKS_STRCASECMP */
00570 }

int ACE_OS_String::strncasecmp_emulation const char *    s,
const char *    t,
size_t    len
[static, private]
 

Emulated strncasecmp - Performs a case insensitvie comparison of arrays.

Definition at line 336 of file OS_String.cpp.

References to_lower.

Referenced by strncasecmp.

00339 {
00340   const char *scan1 = s;
00341   const char *scan2 = t;
00342   size_t count = 0;
00343 
00344   while (count++ < len
00345          && *scan1 != 0
00346          && ACE_OS_String::to_lower (*scan1)
00347             == ACE_OS_String::to_lower (*scan2))
00348     {
00349       ++scan1;
00350       ++scan2;
00351     }
00352 
00353   if (count > len)
00354     return 0;
00355 
00356   // The following case analysis is necessary so that characters which
00357   // look negative collate low against normal characters but high
00358   // against the end-of-string NUL.
00359 
00360   if (*scan1 == '\0' && *scan2 == '\0')
00361     return 0;
00362   else if (*scan1 == '\0')
00363     return -1;
00364   else if (*scan2 == '\0')
00365     return 1;
00366   else
00367     return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
00368 }

ACE_INLINE ACE_WCHAR_T * ACE_OS_String::strncat ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    t,
size_t    len
[static]
 

Appends part of a string to another string (wchar_t version).

Definition at line 254 of file OS_String.inl.

References ACE_WCHAR_T, and wcsncat_emulation.

00255 {
00256 #  if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCAT)
00257   return ACE_OS_String::wcsncat_emulation (s, t, len);
00258 #  else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCAT */
00259   return ::wcsncat (s, t, len);
00260 #  endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCAT */
00261 }

ACE_INLINE char * ACE_OS_String::strncat char *    s,
const char *    t,
size_t    len
[static]
 

Appends part of a string to another string (char version).

Definition at line 248 of file OS_String.inl.

Referenced by ACE_Local_Name_Space::create_manager_i, and strsncpy.

00249 {
00250   return ::strncat (s, t, len);
00251 }

ACE_INLINE ACE_WCHAR_T * ACE_OS_String::strnchr ACE_WCHAR_T *    s,
ACE_WINT_T    c,
size_t    len
[static]
 

Finds the first occurance of a character in an array (ACE_WCHAR_T version).

Definition at line 554 of file OS_String.inl.

References ACE_WCHAR_T, ACE_WINT_T, and strnchr.

00555 {
00556   return ACE_const_cast (ACE_WCHAR_T *,
00557     ACE_OS_String::strnchr (ACE_static_cast (const ACE_WCHAR_T *, s), c, len));
00558 }

ACE_INLINE char * ACE_OS_String::strnchr char *    s,
int    c,
size_t    len
[static]
 

Finds the first occurance of a character in an array (char version).

Definition at line 541 of file OS_String.inl.

References strnchr.

00542 {
00543 #if defined ACE_PSOS_DIAB_PPC  /* Compiler problem Diab 4.2b */
00544   const char *const_char_s = s;
00545   return ACE_const_cast (char *,
00546                          ACE_OS_String::strnchr (const_char_s, c, len));
00547 #else
00548   return ACE_const_cast (char *,
00549     ACE_OS_String::strnchr (ACE_static_cast (const char *, s), c, len));
00550 #endif
00551 }

const ACE_WCHAR_T * ACE_OS_String::strnchr const ACE_WCHAR_T *    s,
ACE_WINT_T    c,
size_t    len
[static]
 

Finds the first occurance of a character in an array (const ACE_WCHAR_T version).

Definition at line 157 of file OS_String.cpp.

References ACE_WCHAR_T, and ACE_WINT_T.

00158 {
00159   for (size_t i = 0; i < len; i++)
00160     if (s[i] == ACE_static_cast(ACE_WCHAR_T, c))
00161       return s + i;
00162 
00163   return 0;
00164 }

const char * ACE_OS_String::strnchr const char *    s,
int    c,
size_t    len
[static]
 

Finds the first occurance of a character in an array (const char version).

Definition at line 147 of file OS_String.cpp.

Referenced by ACE_String_Base::find, and strnchr.

00148 {
00149   for (size_t i = 0; i < len; i++)
00150     if (s[i] == c)
00151       return s + i;
00152 
00153   return 0;
00154 }

ACE_INLINE int ACE_OS_String::strncmp const ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    t,
size_t    len
[static]
 

Compares two arrays (wchar_t version).

Definition at line 270 of file OS_String.inl.

References ACE_WCHAR_T, and wcsncmp_emulation.

00271 {
00272 #  if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCMP)
00273   return ACE_OS_String::wcsncmp_emulation (s, t, len);
00274 #  else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */
00275   return ::wcsncmp (s, t, len);
00276 #  endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */
00277 }

ACE_INLINE int ACE_OS_String::strncmp const char *    s,
const char *    t,
size_t    len
[static]
 

Compares two arrays (char version).

Definition at line 264 of file OS_String.inl.

Referenced by ACE_Registry_ImpExp::import_config, ACE_Get_Opt::long_option_i, ACE_UNIX_Addr::operator==, ACE_SPIPE_Addr::set, and wcsstr_emulation.

00265 {
00266   return ::strncmp (s, t, len);
00267 }

ACE_INLINE ACE_WCHAR_T * ACE_OS_String::strncpy ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    t,
size_t    len
[static]
 

Copies an array (ACE_WCHAR_T version).

Definition at line 286 of file OS_String.inl.

References ACE_WCHAR_T, and wcsncpy_emulation.

00287 {
00288 #  if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCPY)
00289   return ACE_OS_String::wcsncpy_emulation (s, t, len);
00290 #  else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */
00291   return ::wcsncpy (s, t, len);
00292 #  endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */
00293 }

ACE_INLINE char * ACE_OS_String::strncpy char *    s,
const char *    t,
size_t    len
[static]
 

Copies an array (char version).

Definition at line 280 of file OS_String.inl.

00281 {
00282   return ::strncpy (s, t, len);
00283 }

ACE_INLINE size_t ACE_OS_String::strnlen const ACE_WCHAR_T *    s,
size_t    maxlen
[static]
 

Finds the length of a limited-length string (ACE_WCHAR_T version).

Parameters:
s  The character string to find the length of.
maxlen  The maximum number of characters that will be scanned for the terminating nul character.
Returns:
The length of
  • s, if the terminating nul character is located, else
  • maxlen.

Definition at line 234 of file OS_String.inl.

References ACE_WCHAR_T.

00235 {
00236 #if defined (ACE_HAS_WCHAR) && defined (ACE_HAS_WCSNLEN)
00237   return wcsnlen (s, maxlen);
00238 #else /* ACE_HAS_WCSNLEN */
00239   size_t i;
00240   for (i = 0; i < maxlen; ++i)
00241     if (s[i] == '\0')
00242       break;
00243   return i;
00244 #endif /* ACE_HAS_WCSNLEN */
00245 }

ACE_INLINE size_t ACE_OS_String::strnlen const char *    s,
size_t    maxlen
[static]
 

Finds the length of a limited-length string (char version).

Parameters:
s  The character string to find the length of.
maxlen  The maximum number of characters that will be scanned for the terminating nul character.
Returns:
The length of
  • s, if the terminating nul character is located, else
  • maxlen.

Definition at line 220 of file OS_String.inl.

00221 {
00222 #if defined (ACE_HAS_STRNLEN)
00223   return ::strnlen (s, maxlen);
00224 #else /* ACE_HAS_STRNLEN */
00225   size_t i;
00226   for (i = 0; i < maxlen; ++i)
00227     if (s[i] == '\0')
00228       break;
00229   return i;
00230 #endif /* ACE_HAS_STRNLEN */
00231 }

ACE_INLINE ACE_WCHAR_T * ACE_OS_String::strnstr ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    t,
size_t    len
[static]
 

Finds the first occurance of a substring in an array (wchar_t version).

Definition at line 596 of file OS_String.inl.

References ACE_WCHAR_T, and strnstr.

00597 {
00598   return ACE_const_cast (ACE_WCHAR_T *,
00599     ACE_OS_String::strnstr (ACE_static_cast (const ACE_WCHAR_T *, s), t, len));
00600 }

ACE_INLINE char * ACE_OS_String::strnstr char *    s,
const char *    t,
size_t    len
[static]
 

Finds the first occurance of a substring in an array (char version).

Definition at line 585 of file OS_String.inl.

References strnstr.

00586 {
00587 #if defined ACE_PSOS_DIAB_PPC  /* Compiler problem Diab 4.2b */
00588   const char *const_char_s=s;
00589   return (char *) ACE_OS_String::strnstr (const_char_s, t, len);
00590 #else
00591   return (char *) ACE_OS_String::strnstr ((const char *) s, t, len);
00592 #endif
00593 }

const ACE_WCHAR_T * ACE_OS_String::strnstr const ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    t,
size_t    len
[static]
 

Finds the first occurance of a substring in an array (const wchar_t version).

Definition at line 49 of file OS_String.cpp.

References ACE_WCHAR_T, memcmp, and strlen.

00050 {
00051   // Substring length
00052   size_t len1 = ACE_OS_String::strlen (s1);
00053 
00054   // Check if the substring is longer than the string being searched.
00055   if (len2 > len1)
00056     return 0;
00057 
00058   // Go upto <len>
00059   size_t len = len1 - len2;
00060 
00061   for (size_t i = 0; i <= len; i++)
00062     {
00063       if (ACE_OS_String::memcmp (s1 + i, s2, len2 * sizeof (ACE_WCHAR_T)) == 0)
00064         // Found a match!  Return the index.
00065         return s1 + i;
00066     }
00067 
00068   return 0;
00069 }

const char * ACE_OS_String::strnstr const char *    s,
const char *    t,
size_t    len
[static]
 

Finds the first occurance of a substring in an array (const char version).

Definition at line 26 of file OS_String.cpp.

References memcmp, and strlen.

Referenced by ACE_String_Base::find, and strnstr.

00027 {
00028   // Substring length
00029   size_t len1 = ACE_OS_String::strlen (s1);
00030 
00031   // Check if the substring is longer than the string being searched.
00032   if (len2 > len1)
00033     return 0;
00034 
00035   // Go upto <len>
00036   size_t len = len1 - len2;
00037 
00038   for (size_t i = 0; i <= len; i++)
00039     {
00040       if (ACE_OS_String::memcmp (s1 + i, s2, len2) == 0)
00041         // Found a match!  Return the index.
00042         return s1 + i;
00043     }
00044 
00045   return 0;
00046 }

wchar_t* ACE_OS_String::strpbrk wchar_t *    s1,
const wchar_t *    s2
[static]
 

Searches for characters in a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strpbrk char *    s1,
const char *    s2
[static]
 

Searches for characters in a string (char version).

Definition at line 318 of file OS_String.inl.

00319 {
00320 #if defined (ACE_LACKS_STRPBRK)
00321   return ACE_OS_String::strpbrk_emulation (s1, s2);
00322 #else /* ACE_LACKS_STRPBRK */
00323   return ::strpbrk (s1, s2);
00324 #endif /* ACE_LACKS_STRPBRK */
00325 }

const wchar_t* ACE_OS_String::strpbrk const wchar_t *    s1,
const wchar_t *    s2
[static]
 

Searches for characters in a string (const wchar_t version).

ACE_INLINE const char * ACE_OS_String::strpbrk const char *    s1,
const char *    s2
[static]
 

Searches for characters in a string (const char version).

Definition at line 296 of file OS_String.inl.

Referenced by ACE_Registry_ImpExp::process_previous_line_format.

00297 {
00298 #if defined (ACE_LACKS_STRPBRK)
00299   return ACE_OS_String::strpbrk_emulation (s1, s2);
00300 #else  /* ACE_LACKS_STRPBRK */
00301   return (const char *) ::strpbrk (s1, s2);
00302 #endif /* ACE_LACKS_STRPBRK */
00303 }

wchar_t* ACE_OS_String::strrchr wchar_t *    s,
wint_t    c
[static]
 

Finds the last occurance of a character in a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strrchr char *    s,
int    c
[static]
 

Finds the last occurance of a character in a string (char version).

Definition at line 359 of file OS_String.inl.

References strrchr_emulation.

00360 {
00361 #if defined (ACE_LACKS_STRRCHR)
00362   return ACE_OS_String::strrchr_emulation (s, c);
00363 #else  /* ! ACE_LACKS_STRRCHR */
00364   return ::strrchr (s, c);
00365 #endif /* ! ACE_LACKS_STRRCHR */
00366 }

const wchar_t* ACE_OS_String::strrchr const wchar_t *    s,
wint_t    c
[static]
 

Finds the last occurance of a character in a string (const wchar_t version).

ACE_INLINE const char * ACE_OS_String::strrchr const char *    s,
int    c
[static]
 

Finds the last occurance of a character in a string (const char version).

Definition at line 337 of file OS_String.inl.

References strrchr_emulation.

Referenced by ACE::basename, ACE::dirname, ACE_Ini_ImpExp::import_config, ACE_Registry_ImpExp::import_config, ACE_Lib_Find::ldfind, ACE_OS::sema_init, and ACE_INET_Addr::string_to_addr.

00338 {
00339 #if defined (ACE_LACKS_STRRCHR)
00340   return ACE_OS_String::strrchr_emulation (s, c);
00341 #else  /* ! ACE_LACKS_STRRCHR */
00342   return (const char *) ::strrchr (s, c);
00343 #endif /* ! ACE_LACKS_STRRCHR */
00344 }

const char * ACE_OS_String::strrchr_emulation const char *    s,
int    c
[static, private]
 

Emulated strrchr (const char version) - Finds the last occurance of a character in a string.

Definition at line 182 of file OS_String.cpp.

References strlen.

00183 {
00184   const char *p = s + ACE_OS_String::strlen (s);
00185 
00186   while (*p != c)
00187     if (p == s)
00188       return 0;
00189     else
00190       p--;
00191 
00192   return p;
00193 }

char * ACE_OS_String::strrchr_emulation char *    s,
int    c
[static, private]
 

Emulated strrchr (char version) - Finds the last occurance of a character in a string.

Definition at line 168 of file OS_String.cpp.

References strlen.

Referenced by strrchr.

00169 {
00170   char *p = s + ACE_OS_String::strlen (s);
00171 
00172   while (*p != c)
00173     if (p == s)
00174       return 0;
00175     else
00176       p--;
00177 
00178   return p;
00179 }

ACE_WCHAR_T * ACE_OS_String::strsncpy ACE_WCHAR_T *    dst,
const ACE_WCHAR_T *    src,
size_t    maxlen
[static]
 

This is a "safe" c string copy function (wchar_t version).

Unlike strncpy() this function will always add a terminating '\0' char if maxlen > 0. So the user doesn't has to provide an extra '\0' if the user wants a '\0' terminated dst. The function doesn't check for a 0 <dst>, because this will give problems anyway. When <src> is 0 an empty string is made. We do not "touch" *<dst> if maxlen is 0. Returns <dst>. Care should be taken when replacing strncpy() calls, because in some cases a strncpy() user is using the "not '\0' terminating" feature from strncpy(). This happens most when the call to strncpy() was optimized by using a maxlen which is 1 smaller than the size because there's always written a '\0' inside this last position. Very seldom it's possible that the '\0' padding feature from strncpy() is needed.

Definition at line 1053 of file OS_String.cpp.

References ACE_TEXT_WIDE, ACE_WCHAR_T, and strncat.

01054 {
01055   register ACE_WCHAR_T *rdst = dst;
01056   register const ACE_WCHAR_T *rsrc = src;
01057   register size_t rmaxlen = maxlen;
01058 
01059     if (rmaxlen > 0)
01060     {
01061       if (rdst!=rsrc)
01062         {
01063           *rdst = ACE_TEXT_WIDE ('\0');
01064           if (rsrc != 0)
01065             strncat (rdst, rsrc, --rmaxlen);
01066         }
01067       else
01068         {
01069           rdst += (rmaxlen - 1);
01070           *rdst = ACE_TEXT_WIDE ('\0');
01071         }
01072     }
01073   return dst;
01074 }

char * ACE_OS_String::strsncpy char *    dst,
const char *    src,
size_t    maxlen
[static]
 

This is a "safe" c string copy function (char version).

Unlike strncpy() this function will always add a terminating '\0' char if maxlen > 0. So the user doesn't has to provide an extra '\0' if the user wants a '\0' terminated dst. The function doesn't check for a 0 <dst>, because this will give problems anyway. When <src> is 0 an empty string is made. We do not "touch" *<dst> if maxlen is 0. Returns <dst>. Care should be taken when replacing strncpy() calls, because in some cases a strncpy() user is using the "not '\0' terminating" feature from strncpy(). This happens most when the call to strncpy() was optimized by using a maxlen which is 1 smaller than the size because there's always written a '\0' inside this last position. Very seldom it's possible that the '\0' padding feature from strncpy() is needed.

Definition at line 1029 of file OS_String.cpp.

References strncat.

Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool, ACE_Mutex_Token::ACE_Mutex_Token, ACE_Pagefile_Memory_Pool::ACE_Pagefile_Memory_Pool, ACE_RW_Token::ACE_RW_Token, ACE_STATIC_SVC_DEFINE, ACE_System_Time::ACE_System_Time, ACE_Token_Collection::ACE_Token_Collection, ACE_UNIX_Addr::addr_to_string, ACE_SPIPE_Addr::addr_to_string, ACE_FILE_Addr::addr_to_string, ACE_DEV_Addr::addr_to_string, ACE_OS::asctime_r, ACE_TPQ_Entry::client_id, ACE_Local_Name_Space::create_manager_i, ACE_OS::ctime_r, ACE::dirname, ACE_Log_Msg::file, ACE_INET_Addr::get_host_addr, ACE_Thru_Task::info, ACE_Stream_Tail::info, ACE_Stream_Head::info, ACE_Stream_Type::info, ACE_Module_Type::info, ACE_Service_Manager::info, ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info, ACE_Oneshot_Acceptor::info, ACE_Strategy_Acceptor::info, ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info, ACE_Log_Msg::log, ACE_Log_Msg::msg, ACE_Log_Record::msg_data, ACE_Module< ACE_SYNCH_USE >::name, ACE_Mem_Map::open, ACE_FIFO::open, ACE_String_Base::rep, ACE_Local_Name_Space::resolve_i, ACE_SPIPE_Addr::set, ACE_FILE_Addr::set, ACE_DEV_Addr::set, ACE_UNIX_Addr::string_to_addr, ACE::strndup, ACE::strnnew, ACE_OS::thr_create, ACE::timestamp, ACE_Name_Request::type, and ACE_OS::unique_name.

01030 {
01031   register char *rdst = dst;
01032   register const char *rsrc = src;
01033   register size_t rmaxlen = maxlen;
01034 
01035   if (rmaxlen > 0)
01036     {
01037       if (rdst!=rsrc)
01038         {
01039           *rdst = '\0';
01040           if (rsrc != 0)
01041             strncat (rdst, rsrc, --rmaxlen);
01042         }
01043       else
01044         {
01045           rdst += (rmaxlen - 1);
01046           *rdst = '\0';
01047         }
01048     }
01049   return dst;
01050 }

size_t ACE_OS_String::strspn const wchar_t *    s1,
const wchar_t *    s2
[static]
 

Searches for the first substring containing only the specified characters and returns the size of the substring (wchar_t version).

ACE_INLINE size_t ACE_OS_String::strspn const char *    s1,
const char *    s2
[static]
 

Searches for the first substring containing only the specified characters and returns the size of the substring (char version).

Definition at line 378 of file OS_String.inl.

Referenced by ACE_Arg_Shifter::cur_arg_strncasecmp, and ACE_INET_Addr::string_to_addr.

00379 {
00380 #if defined (ACE_LACKS_STRSPN)
00381   return ACE_OS_String::strspn_emulation (s, t);
00382 #else /* ACE_LACKS_STRSPN */
00383   return ::strspn (s, t);
00384 #endif /* ACE_LACKS_STRSPN */
00385 }

wchar_t* ACE_OS_String::strstr wchar_t *    s,
const wchar_t *    t
[static]
 

Finds the first occurance of a substring in a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strstr char *    s,
const char *    t
[static]
 

Finds the first occurance of a substring in a string (char version).

Definition at line 420 of file OS_String.inl.

00421 {
00422   return ::strstr (s, t);
00423 }

const wchar_t* ACE_OS_String::strstr const wchar_t *    s,
const wchar_t *    t
[static]
 

Finds the first occurance of a substring in a string (const wchar_t version).

ACE_INLINE const char * ACE_OS_String::strstr const char *    s,
const char *    t
[static]
 

Finds the first occurance of a substring in a string (const char version).

Definition at line 400 of file OS_String.inl.

Referenced by ACE::execname, ACE_SString::find, ACE_ATM_Stream::get_peer_name, ACE_Local_Name_Space::list_type_entries_i, ACE_Local_Name_Space::list_types_i, ACE_DLL_Handle::open, and ACE_Lib_Find::strsplit_r.

00401 {
00402   return (const char *) ::strstr (s, t);
00403 }

double ACE_OS_String::strtod const wchar_t *    s,
wchar_t **    endptr
[static]
 

Converts a string to a double value (wchar_t version).

ACE_INLINE double ACE_OS_String::strtod const char *    s,
char **    endptr
[static]
 

Converts a string to a double value (char version).

Definition at line 631 of file OS_String.inl.

Referenced by ACE_Convert.

00632 {
00633   return ::strtod (s, endptr);
00634 }

wchar_t* ACE_OS_String::strtok wchar_t *    s,
const wchar_t *    tokens
[static]
 

Finds the next token in a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strtok char *    s,
const char *    tokens
[static]
 

Finds the next token in a string (char version).

Definition at line 440 of file OS_String.inl.

00441 {
00442   return ::strtok (s, tokens);
00443 }

wchar_t* ACE_OS_String::strtok_r ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    tokens,
ACE_WCHAR_T **    lasts
[static]
 

Finds the next token in a string (wchar_t version).

ACE_INLINE char * ACE_OS_String::strtok_r char *    s,
const char *    tokens,
char **    lasts
[static]
 

Finds the next token in a string (safe char version).

Definition at line 603 of file OS_String.inl.

References strtok_r_emulation.

Referenced by ACE_ATM_Stream::get_peer_name, ACE_Logging_Strategy::priorities, and ACE_Logging_Strategy::tokenize.

00604 {
00605 #if defined (ACE_HAS_REENTRANT_FUNCTIONS)
00606   return ::strtok_r (s, tokens, lasts);
00607 #else
00608   return ACE_OS_String::strtok_r_emulation (s, tokens, lasts);
00609 #endif /* (ACE_HAS_REENTRANT_FUNCTIONS) */
00610 }

wchar_t* ACE_OS_String::strtok_r_emulation ACE_WCHAR_T *    s,
const ACE_WCHAR_T *    tokens,
ACE_WCHAR_T **    lasts
[static, private]
 

Emulated strtok_r (wchar_t version).

char * ACE_OS_String::strtok_r_emulation char *    s,
const char *    tokens,
char **    lasts
[static, private]
 

Emulated strtok_r.

Definition at line 410 of file OS_String.cpp.

References strlen.

Referenced by strtok_r.

00411 {
00412   if (s == 0)
00413     s = *lasts;
00414   else
00415     *lasts = s;
00416   if (*s == 0)                  // We have reached the end
00417     return 0;
00418   size_t l_org = ACE_OS_String::strlen (s);
00419   s = ::strtok (s, tokens);
00420   if (s == 0)
00421     return 0;
00422   size_t l_sub = ACE_OS_String::strlen (s);
00423   if (s + l_sub < *lasts + l_org)
00424     *lasts = s + l_sub + 1;
00425   else
00426     *lasts = s + l_sub;
00427   return s ;
00428 }

long ACE_OS_String::strtol const wchar_t *    s,
wchar_t **    ptr,
int    base
[static]
 

Converts a string to a long value (wchar_t version).

ACE_INLINE long ACE_OS_String::strtol const char *    s,
char **    ptr,
int    base
[static]
 

Converts a string to a long value (char version).

Definition at line 646 of file OS_String.inl.

Referenced by ACE_Convert.

00647 {
00648 #if defined (ACE_LACKS_STRTOL)
00649   return ACE_OS_String::strtol_emulation (s, ptr, base);
00650 #else  /* ACE_LACKS_STRTOL */
00651   return ::strtol (s, ptr, base);
00652 #endif /* ACE_LACKS_STRTOL */
00653 }

unsigned long ACE_OS_String::strtoul const wchar_t *    s,
wchar_t **    ptr,
int    base
[static]
 

Converts a string to an unsigned long value (wchar_t version).

ACE_INLINE unsigned long ACE_OS_String::strtoul const char *    s,
char **    ptr,
int    base
[static]
 

Converts a string to an unsigned long value (char version).

Definition at line 664 of file OS_String.inl.

Referenced by ACE_Convert, ACE_MEM_Addr::ACE_MEM_Addr, ACE_Registry_ImpExp::import_config, ACE_Logging_Strategy::parse_args, and ACE_MEM_Addr::string_to_addr.

00665 {
00666 #if defined (ACE_LACKS_STRTOUL)
00667   return ACE_OS_String::strtoul_emulation (s, ptr, base);
00668 #else /* ACE_LACKS_STRTOUL */
00669   return ::strtoul (s, ptr, base);
00670 #endif /* ACE_LACKS_STRTOUL */
00671 }

wint_t ACE_OS_String::to_lower wint_t    c [static]
 

Converts a character to lower case (wchar_t version).

ACE_INLINE int ACE_OS_String::to_lower int    c [static]
 

Converts a character to lower case (char version).

Definition at line 479 of file OS_String.inl.

Referenced by strcasecmp_emulation, strncasecmp_emulation, wcsicmp_emulation, and wcsnicmp_emulation.

00480 {
00481   return tolower (c);
00482 }

wchar_t * ACE_OS_String::wcscat_emulation wchar_t *    destination,
const wchar_t *    source
[static, private]
 

Emulated wcscat - Appends a string.

Definition at line 641 of file OS_String.cpp.

00643 {
00644   wchar_t *save = destination;
00645 
00646   for (; *destination; ++destination);
00647   while ((*destination++ = *source++));
00648   return save;
00649 }

wchar_t * ACE_OS_String::wcschr_emulation const wchar_t *    string,
wint_t    c
[static, private]
 

Emulated wcschr - Finds a character in a string.

Definition at line 849 of file OS_String.cpp.

00850 {
00851   for (;*string ; ++string)
00852     if (*string == ACE_static_cast (wchar_t, c))
00853       return ACE_const_cast (wchar_t *, string);
00854 
00855   return 0;
00856 }

int ACE_OS_String::wcscmp_emulation const ACE_WCHAR_T *    string1,
const ACE_WCHAR_T *    string2
[static, private]
 

Emulated wcscmp - Compares strings.

Definition at line 758 of file OS_String.cpp.

References ACE_WCHAR_T.

Referenced by strcmp.

00760 {
00761   while (*string1 == *string2++)
00762     if (*string1++ == 0)
00763       return (0);
00764   return (*string1 - *--string2);
00765 }

wchar_t * ACE_OS_String::wcscpy_emulation wchar_t *    destination,
const wchar_t *    source
[static, private]
 

Emulated wcscpy - Copies a string.

Definition at line 770 of file OS_String.cpp.

00772 {
00773   wchar_t *save = destination;
00774 
00775   for (; (*destination = *source); ++source, ++destination);
00776   return save;
00777 }

size_t ACE_OS_String::wcscspn_emulation const wchar_t *    string,
const wchar_t *    reject
[static, private]
 

Emulated wcscspn.

Definition at line 579 of file OS_String.cpp.

00580 {
00581   const wchar_t *scan;
00582   const wchar_t *rej_scan;
00583   int count = 0;
00584 
00585   for (scan = s; *scan; scan++)
00586     {
00587 
00588       for (rej_scan = reject; *rej_scan; rej_scan++)
00589         if (*scan == *rej_scan)
00590           return count;
00591 
00592       count++;
00593     }
00594 
00595   return count;
00596 }

int ACE_OS_String::wcsicmp_emulation const wchar_t *    string1,
const wchar_t *    string2
[static, private]
 

Emulated wcsicmp - Performs a case insensitive comparison of strings.

Definition at line 306 of file OS_String.cpp.

References to_lower.

00307 {
00308   const wchar_t *scan1 = s;
00309   const wchar_t *scan2 = t;
00310 
00311   while (*scan1 != 0
00312          && ACE_OS_String::to_lower (*scan1)
00313             == ACE_OS_String::to_lower (*scan2))
00314     {
00315       ++scan1;
00316       ++scan2;
00317     }
00318 
00319   // The following case analysis is necessary so that characters which
00320   // look negative collate low against normal characters but high
00321   // against the end-of-string NUL.
00322 
00323   if (*scan1 == '\0' && *scan2 == '\0')
00324     return 0;
00325   else if (*scan1 == '\0')
00326     return -1;
00327   else if (*scan2 == '\0')
00328     return 1;
00329   else
00330     return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
00331 }

size_t ACE_OS_String::wcslen_emulation const ACE_WCHAR_T *    string [static, private]
 

Emulated wcslen - Returns the length of a string.

Definition at line 718 of file OS_String.cpp.

References ACE_WCHAR_T.

Referenced by strlen.

00719 {
00720   const ACE_WCHAR_T *s;
00721 
00722   for (s = string; *s; ++s)
00723     continue;
00724 
00725   return s - string;
00726 }

ACE_WCHAR_T * ACE_OS_String::wcsncat_emulation ACE_WCHAR_T *    destination,
const ACE_WCHAR_T *    source,
size_t    count
[static, private]
 

Emulated wcscat - Appends a string.

Definition at line 820 of file OS_String.cpp.

References ACE_WCHAR_T.

Referenced by strncat.

00823 {
00824   if (count != 0)
00825     {
00826       ACE_WCHAR_T *d = destination;
00827       const ACE_WCHAR_T *s = source;
00828 
00829       while (*d != 0)
00830         d++;
00831 
00832       do
00833         {
00834           if ((*d = *s++) == 0)
00835             break;
00836 
00837           d++;
00838         } while (--count != 0);
00839 
00840       *d = 0;
00841     }
00842 
00843   return destination;
00844 }

int ACE_OS_String::wcsncmp_emulation const ACE_WCHAR_T *    string1,
const ACE_WCHAR_T *    string2,
size_t    len
[static, private]
 

Emulated wcsncmp - Compares two arrays.

Definition at line 861 of file OS_String.cpp.

References ACE_WCHAR_T.

Referenced by strncmp.

00864 {
00865   if (len == 0)
00866     return 0;
00867 
00868   do
00869     {
00870       if (*s1 != *s2++)
00871         return (*s1 - *--s2);
00872       if (*s1++ == 0)
00873         break;
00874     } while (--len != 0);
00875 
00876   return 0;
00877 }

ACE_WCHAR_T * ACE_OS_String::wcsncpy_emulation ACE_WCHAR_T *    destination,
const ACE_WCHAR_T *    source,
size_t    len
[static, private]
 

Emulated wcsncpy - Copies an array.

Definition at line 731 of file OS_String.cpp.

References ACE_WCHAR_T.

Referenced by strncpy.

00734 {
00735   if (len != 0)
00736     {
00737       ACE_WCHAR_T *d = destination;
00738       const ACE_WCHAR_T *s = source;
00739 
00740       do
00741         {
00742           if ((*d++ = *s++) == 0)
00743             {
00744               // NUL pad the remaining n-1 bytes
00745               while (--len != 0)
00746                 *d++ = 0;
00747               break;
00748             }
00749         } while (--len != 0);
00750     }
00751 
00752   return destination;
00753 }

int ACE_OS_String::wcsnicmp_emulation const wchar_t *    string1,
const wchar_t *    string2,
size_t    len
[static, private]
 

Emulated wcsnicmp - Performs a case insensitive comparison of two arrays.

Definition at line 373 of file OS_String.cpp.

References to_lower.

00376 {
00377   const wchar_t *scan1 = s;
00378   const wchar_t *scan2 = t;
00379   size_t count = 0;
00380 
00381   while (count++ < len
00382          && *scan1 != 0
00383          && ACE_OS_String::to_lower (*scan1)
00384             == ACE_OS_String::to_lower (*scan2))
00385     {
00386       ++scan1;
00387       ++scan2;
00388     }
00389 
00390   if (count > len)
00391     return 0;
00392 
00393   // The following case analysis is necessary so that characters which
00394   // look negative collate low against normal characters but high
00395   // against the end-of-string NUL.
00396 
00397   if (*scan1 == '\0' && *scan2 == '\0')
00398     return 0;
00399   else if (*scan1 == '\0')
00400     return -1;
00401   else if (*scan2 == '\0')
00402     return 1;
00403   else
00404     return ACE_OS_String::to_lower (*scan1) - ACE_OS_String::to_lower (*scan2);
00405 }

wchar_t * ACE_OS_String::wcspbrk_emulation const wchar_t *    string,
const wchar_t *    charset
[static, private]
 

Emulated wcspbrk - Searches for characters in a string.

Definition at line 801 of file OS_String.cpp.

00803 {
00804   const wchar_t *scanp;
00805   int c, sc;
00806 
00807   while ((c = *string++) != 0)
00808     {
00809       for (scanp = charset; (sc = *scanp++) != 0;)
00810         if (sc == c)
00811           return ACE_const_cast (wchar_t *, string - 1);
00812     }
00813 
00814   return 0;
00815 }

const wchar_t * ACE_OS_String::wcsrchr_emulation const wchar_t *    string,
wint_t    c
[static, private]
 

Emulated wcsrchr (const wchar_t version) - Finds the last occurance of a character in a string.

Definition at line 198 of file OS_String.cpp.

References strlen.

00199 {
00200   const wchar_t *p = s + ACE_OS_String::strlen (s);
00201 
00202   while (*p != ACE_static_cast (wchar_t, c))
00203     if (p == s)
00204       return 0;
00205     else
00206       p--;
00207 
00208   return p;
00209 }

wchar_t * ACE_OS_String::wcsrchr_emulation wchar_t *    string,
wint_t    c
[static, private]
 

Emulated wcsrchr (wchar_t version) - Finds the last occurance of a character in a string.

Definition at line 212 of file OS_String.cpp.

References strlen.

00213 {
00214   wchar_t *p = s + ACE_OS_String::strlen (s);
00215 
00216   while (*p != ACE_static_cast(wchar_t, c))
00217     if (p == s)
00218       return 0;
00219     else
00220       p--;
00221 
00222   return p;
00223 }

size_t ACE_OS_String::wcsspn_emulation const wchar_t *    string,
const wchar_t *    charset
[static, private]
 

Emulated wcsspn.

Definition at line 673 of file OS_String.cpp.

00675 {
00676   const wchar_t *p = string;
00677   const wchar_t *spanp;
00678   wchar_t c, sc;
00679 
00680   // Skip any characters in charset, excluding the terminating \0.
00681 cont:
00682   c = *p++;
00683   for (spanp = charset; (sc = *spanp++) != 0;)
00684     if (sc == c)
00685       goto cont;
00686   return (p - 1 - string);
00687 }

wchar_t * ACE_OS_String::wcsstr_emulation const wchar_t *    string,
const wchar_t *    charset
[static, private]
 

Emulated wcsstr - Performs a case insensitive comparison of two strings.

Definition at line 692 of file OS_String.cpp.

References strlen, and strncmp.

00694 {
00695   wchar_t c, sc;
00696   size_t len;
00697 
00698   if ((c = *charset++) != 0)
00699     {
00700       len = strlen(charset);
00701       do
00702         {
00703           do
00704             {
00705               if ((sc = *string++) == 0)
00706                 return 0;
00707             } while (sc != c);
00708         } while (strncmp(string, charset, len) != 0);
00709       string--;
00710     }
00711 
00712   return ACE_const_cast (wchar_t *, string);
00713 }


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:51:52 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002