class CCL::Boxed::String

#include <boxedtypes.h>

class String:
    public CCL::Object,
    public CCL::String
{
public:
    // fields

    DECLARE_CLASS (String, Object) String (CCL typedef ValueHelper <Boxed::String, CCL::String> Value;

    // methods

    String& operator = (CCL::StringRef string);
    virtual bool equals (const Object& obj) const;
    virtual int compare (const Object& obj) const;
    virtual bool load (const Storage& storage);
    virtual bool save (const Storage& storage) const;
    virtual bool toString (CCL::String& string, int flags = 0) const;
    virtual int getHashCode (int size) const;
};

Inherited Members

public:
    // typedefs

    typedef CStringRef MemberID;

    // fields

    IString* theString;
    IStringPrivateData __private;
    static const String kEmpty;

    // methods

    virtual tresult CCL_API queryInterface (UIDRef iid, void** ptr) = 0;
    virtual unsigned int CCL_API retain () = 0;
    virtual unsigned int CCL_API release () = 0;
    Unknown& operator = (const Unknown&);
    unsigned int getRetainCount () const;
    virtual Object*CCL_API revealObject (const void* moduleAddress) = 0;
    virtual void CCL_API addObserver (IObserver* observer) = 0;
    virtual void CCL_API removeObserver (IObserver* observer) = 0;
    virtual void CCL_API signal (MessageRef msg) = 0;
    virtual void CCL_API deferSignal (IMessage* msg) = 0;
    static ISubject void addObserver (IUnknown* unknown, IObserver* observer);
    static void removeObserver (IUnknown* unknown, IObserver* observer);
    virtual void CCL_API notify (ISubject* subject, MessageRef msg) = 0;

    static IObserver void notify (
        IUnknown* unknown,
        ISubject* subject,
        MessageRef msg
    );

    virtual const ITypeInfo&CCL_API getTypeInfo () const = 0;
    virtual tbool CCL_API getProperty (Variant& var, MemberID propertyId) const = 0;
    virtual tbool CCL_API setProperty (MemberID propertyId, const Variant& var) = 0;
    virtual tbool CCL_API getPropertyNames (IPropertyCollector& collector) const = 0;
    virtual tbool CCL_API invokeMethod (Variant& returnValue, MessageRef msg) = 0;
    DECLARE_BASE_CLASS (Object);
    virtual void CCL_API removeObserver (IObserver* observer);
    virtual void CCL_API signal (MessageRef msg);
    virtual void CCL_API deferSignal (IMessage* msg);
    virtual void deferChanged ();
    virtual void CCL_API notify (ISubject* subject, MessageRef msg);
    virtual bool equals (const Object& obj) const;
    virtual int compare (const Object& obj) const;
    virtual bool load (const Storage& storage);
    virtual bool save (const Storage& storage) const;
    virtual bool save (const OutputStorage& storage) const;
    virtual bool toString (String& string, int flags = 0) const;
    virtual int getHashCode (int size) const;
    IUnknown* asUnknown ();
    static void addGarbageCollected (Object* obj, bool globalScope = true);
    static void deferDestruction (Object* obj);
    static const void* getModuleAddress ();
    String& operator = (const String& other);
    bool isEmpty () const;
    int length () const;
    uchar at (int index) const;
    uchar firstChar () const;
    uchar lastChar () const;
    uchar operator [] (int index) const;
    bool copyTo (uchar* charBuffer, int bufferSize) const;

    bool toCString (
        TextEncoding encoding,
        char* cString,
        int cStringSize,
        int* bytesWritten = nullptr
    ) const;

    bool toPascalString (
        TextEncoding encoding,
        unsigned char* pString,
        int pStringSize
    ) const;

    bool toASCII (
        char* asciiString,
        int asciiStringSize,
        int* bytesWritten = nullptr
    ) const;

    bool equals (StringRef otherString) const;
    bool equalsChars (const uchar* charBuffer, int count = -1) const;
    int compare (StringRef otherString, bool caseSensitive = true) const;
    int compareWithOptions (StringRef otherString, int flags) const;
    int compareChars (const uchar* charBuffer, int count = -1) const;
    bool operator == (StringRef s) const;
    bool operator != (StringRef s) const;
    bool operator > (StringRef s) const;
    bool operator >= (StringRef s) const;
    bool operator < (StringRef s) const;
    bool operator <= (StringRef s) const;
    int index (StringRef otherString, bool caseSensitive = true) const;
    int lastIndex (StringRef otherString, bool caseSensitive = true) const;
    bool contains (StringRef otherString, bool caseSensitive = true) const;
    bool startsWith (StringRef otherString, bool caseSensitive = true) const;
    bool endsWith (StringRef otherString, bool caseSensitive = true) const;
    String subString (int index, int count = -1) const;
    IStringTokenizer* tokenize (StringRef delimiters, int flags = 0) const;
    unsigned int getHashCode () const;
    bool getFloatValue (float& value) const;
    bool getFloatValue (double& value) const;
    float scanFloat (float fallback = 0) const;
    double scanDouble (double fallback = 0) const;
    bool getIntValue (int32& value) const;
    bool getIntValue (int64& value) const;
    int scanInt (int fallback = 0) const;
    int64 scanLargetInt (int64 fallback = 0) const;
    bool getHexValue (int64& value) const;
    int scanFormat (StringRef format, Variant args [], int count) const;

    template  <typename Type>
    Type createNativeString () const;

    template  <typename Type>
    void releaseNativeString (Type nativeString);

    void writeEnable ();
    void empty ();
    String& assign (const uchar* charBuffer, int count = -1);
    String& operator = (const uchar* charBuffer);
    String& append (StringRef otherString);
    String& append (StringRef otherString, int count);
    String& append (const uchar* charBuffer, int count = -1);
    String& append (uchar uc);
    bool appendCString (TextEncoding encoding, const char* cString, int count = -1);
    bool appendPascalString (TextEncoding encoding, const unsigned char* pString);
    bool appendNativeString (const void* nativeString);
    String& appendASCII (const char* asciiString, int count = -1);
    String& appendFormat (StringRef format, Variant args [], int count);
    String& appendFormat (StringRef format, VariantRef arg1);
    String& appendFormat (StringRef format, VariantRef arg1, VariantRef arg2);

    String& appendFormat (
        StringRef format,
        VariantRef arg1,
        VariantRef arg2,
        VariantRef arg3
    );

    String& appendFormat (
        StringRef format,
        VariantRef arg1,
        VariantRef arg2,
        VariantRef arg3,
        VariantRef arg4
    );

    String& appendIntValue (int v, int numPaddingZeros = -1);
    String& appendIntValue (int64 v, int numPaddingZeros = -1);
    String& appendHexValue (int v, int numPaddingZeros = -1);
    String& appendHexValue (int64 v, int numPaddingZeros = -1);
    String& appendFloatValue (float v, int numDecimalDigits = -1);
    String& appendFloatValue (double v, int numDecimalDigits = -1);
    String& operator << (int v);
    String& operator << (int64 v);
    String& operator << (float v);
    String& operator << (double v);
    String& operator << (StringRef s);
    String& operator << (const uchar* charBuffer);
    String& operator << (const char* asciiString);
    String& insert (int index, StringRef otherString);
    String& prepend (StringRef otherString);
    String& remove (int index, int count);
    String& remove (StringRef otherString, bool caseSensitive = true);
    String& truncate (int index);
    String& trimWhitespace ();
    String& toUppercase ();
    String& toLowercase ();
    String& capitalize ();
    String& substitute (int flags = 0);
    bool isNormalized (NormalizationForm form) const;
    String& normalize (NormalizationForm form);

    int replace (
        StringRef searchString,
        StringRef replacementString,
        bool caseSensitive = true
    );

    static StringRef getLineEnd (TextLineFormat lineFormat = Text::kSystemLineFormat);