version 1.91, 2005/11/06 21:00:57
|
version 1.99, 2007/09/14 18:16:29
|
|
|
//%2005//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; | // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
// EMC Corporation; VERITAS Software Corporation; The Open Group. | // EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
#include <Pegasus/Common/Char16.h> | #include <Pegasus/Common/Char16.h> |
#include <Pegasus/Common/Linkage.h> | #include <Pegasus/Common/Linkage.h> |
| |
// Locale constants |
|
// These constants need to be defined as follows: |
|
// lower case language; underscore; Uppercase Country |
|
const char ENGLISH_US[] = "en_US"; |
|
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class String; | class String; |
|
|
API supports UTF8 | API supports UTF8 |
@exception NullPointer Thrown if str is NULL. | @exception NullPointer Thrown if str is NULL. |
@exception bad_alloc Thrown if there is insufficient memory. | @exception bad_alloc Thrown if there is insufficient memory. |
|
@exception Exception Thrown if str is invalid UTF8 |
*/ | */ |
String(const char* str); | String(const char* str); |
| |
|
|
API supports UTF8 | API supports UTF8 |
@exception NullPointer Thrown if str is NULL. | @exception NullPointer Thrown if str is NULL. |
@exception bad_alloc Thrown if there is insufficient memory. | @exception bad_alloc Thrown if there is insufficient memory. |
|
@exception Exception Thrown if str is invalid UTF8 |
*/ | */ |
String(const char* str, Uint32 n); | String(const char* str, Uint32 n); |
| |
|
|
API supports UTF8 | API supports UTF8 |
@exception NullPointer Thrown if str is NULL. | @exception NullPointer Thrown if str is NULL. |
@exception bad_alloc Thrown if there is insufficient memory. | @exception bad_alloc Thrown if there is insufficient memory. |
|
@exception Exception Thrown if str is invalid UTF8 |
*/ | */ |
String& assign(const char* str); | String& assign(const char* str); |
| |
|
|
API supports UTF8 | API supports UTF8 |
@exception NullPointer Thrown if str is NULL. | @exception NullPointer Thrown if str is NULL. |
@exception bad_alloc Thrown if there is insufficient memory. | @exception bad_alloc Thrown if there is insufficient memory. |
|
@exception Exception Thrown if str is invalid UTF8 |
*/ | */ |
String& assign(const char* str, Uint32 n); | String& assign(const char* str, Uint32 n); |
| |
|
|
void toUpper(); | void toUpper(); |
#endif | #endif |
| |
/** Compare the first n characters of the two strings. |
/** |
@param s1 First null-terminated string for the comparison. |
Compares the first n characters of two String objects. |
@param s2 Second null-terminated string for the comparison. |
@param s1 The first String to compare. |
@param n Number of characters to compare. |
@param s2 The second String to compare. |
@return Return -1 If s1 is lexographically less than s2; if they are |
@param n The maximum number of characters to compare. |
equivalent return 0; otherwise return 1. |
@return Returns a negative integer if the first n characters of s1 |
|
are lexographically less than s2, 0 if the first n characters of s1 |
|
and s2 are equal, and a positive integer otherwise. |
*/ | */ |
static int compare(const String& s1, const String& s2, Uint32 n); | static int compare(const String& s1, const String& s2, Uint32 n); |
| |
/** Compare two null-terminated strings. |
/** |
@param s1 First null-terminated string for the comparison. |
Compares two String objects. |
@param s2 Second null-terminated string for the comparison. |
@param s1 The first String to compare. |
@return Return -1 if s1 is less than s2; if equal return 0; |
@param s2 The second String to compare. |
otherwise return 1. |
@return Returns a negative integer if s1 is lexographically less |
|
than s2, 0 if s1 and s2 are equal, and a positive integer otherwise. |
| |
NOTE: Use the comparison operators <,<= > >= to compare | NOTE: Use the comparison operators <,<= > >= to compare |
String objects. | String objects. |
*/ | */ |
static int compare(const String& s1, const String& s2); | static int compare(const String& s1, const String& s2); |
| |
/** Compare two null-terminated strings but ignore case. |
/** |
@param s1 First null-terminated string for the comparison. |
Compares two String objects, ignoring case differences. |
@param s2 Second null-terminated string for the comparison. |
@param s1 The first String to compare. |
@return Return -1 if s1 is less than s2; if equal return 0; |
@param s2 The second String to compare. |
otherwise return 1. |
@return Returns a negative integer if s1 is lexographically less |
|
than s2, 0 if s1 and s2 are equal, and a positive integer otherwise. |
NOTE: Use the comparison operators <,<= > >= to compare |
(Case differences are ignored in all cases.) |
String objects. |
|
*/ | */ |
static int compareNoCase(const String& s1, const String& s2); | static int compareNoCase(const String& s1, const String& s2); |
| |
|
|
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |
#if defined(PEGASUS_INTERNALONLY) && !defined(PEGASUS_DISABLE_INTERNAL_INLINES) |
#if defined(PEGASUS_INTERNALONLY) |
# include "StringInline.h" | # include "StringInline.h" |
#endif | #endif |
| |