AAX SDK  2.1.1
Avid Audio Extensions Development Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AAX_CString.h
Go to the documentation of this file.
1 /*================================================================================================*/
2 /*
3  *
4  * Copyright 2013 by Avid Technology, Inc.
5  * All rights reserved.
6  *
7  * CONFIDENTIAL: This document contains confidential information. Do not
8  * read or examine this document unless you are an Avid Technology employee
9  * or have signed a non-disclosure agreement with Avid Technology which protects
10  * the confidentiality of this document. DO NOT DISCLOSE ANY INFORMATION
11  * CONTAINED IN THIS DOCUMENT TO ANY THIRD-PARTY WITHOUT THE PRIOR WRITTEN CONSENT
12  * OF Avid Technolgy, INC.
13  *
14  */
15 
22 /*================================================================================================*/
23 
24 
25 #ifndef AAX_CSTRING_H
26 #define AAX_CSTRING_H
27 
28 #include "AAX_IString.h"
29 #include <string>
30 
31 
35 class AAX_CString : public AAX_IString
36 {
37 public:
38  static const uint32_t kInvalidIndex = static_cast<uint32_t>(-1);
39  static const uint32_t kMaxStringLength = static_cast<uint32_t>(-2);
40 
41  // AAX_IString Virtual Overrides
42  virtual uint32_t Length() const;
43  virtual uint32_t MaxLength() const;
44  virtual const char * Get () const;
45  virtual void Set ( const char * iString );
46  virtual AAX_IString & operator=(const AAX_IString & iOther);
47  virtual AAX_IString & operator=(const char * iString);
48 
50  AAX_CString();
51 
53  AAX_CString(const char* str);
54 
56  explicit AAX_CString(const std::string& str);
57 
59  AAX_CString(const AAX_CString& other);
60 
62  AAX_CString(const AAX_IString& other);
63 
64 
66  std::string& StdString();
67 
69  const std::string& StdString() const;
70 
72  AAX_CString& operator=(const AAX_CString& other);
73 
75  AAX_CString & operator=(const std::string& other);
76 
78  friend std::ostream& operator<< (std::ostream& os, const AAX_CString& str);
79 
81  friend std::istream& operator>> (std::istream& os, AAX_CString& str);
82 
83 
84  // String Formatting Functions
85  void Clear();
86  bool Empty() const;
87  AAX_CString& Erase(uint32_t pos, uint32_t n);
88  AAX_CString& Append(const AAX_CString& str);
89  AAX_CString& Append(const char* str);
90  AAX_CString& AppendNumber(double number, int32_t precision);
91  AAX_CString& AppendNumber(int32_t number);
92  AAX_CString& Insert(uint32_t pos, const AAX_CString& str);
93  AAX_CString& Insert(uint32_t pos, const char* str);
94  AAX_CString& InsertNumber(uint32_t pos, double number, int32_t precision);
95  AAX_CString& InsertNumber(uint32_t pos, int32_t number);
96  AAX_CString& Replace(uint32_t pos, uint32_t n, const AAX_CString& str);
97  AAX_CString& Replace(uint32_t pos, uint32_t n, const char* str);
98  uint32_t FindFirst(const AAX_CString& findStr) const;
99  uint32_t FindFirst(const char* findStr) const;
100  uint32_t FindFirst(char findChar) const;
101  uint32_t FindLast(const AAX_CString& findStr) const;
102  uint32_t FindLast(const char* findStr) const;
103  uint32_t FindLast(char findChar) const;
104  const char* CString() const;
105  bool ToDouble(double* oValue) const;
106  bool ToInteger(int32_t* oValue) const;
107  void SubString(uint32_t pos, uint32_t n, AAX_IString* outputStr) const;
108 
109  // Operator Overrides
110  bool operator==(const AAX_CString& other) const;
111  bool operator==(const char* otherStr) const;
112  bool operator==(const std::string& otherStr) const; //beware of STL variations between binaries.
113  bool operator!=(const AAX_CString& other) const;
114  bool operator!=(const char* otherStr) const;
115  bool operator!=(const std::string& otherStr) const; //beware of STL variations between binaries.
116  bool operator<(const AAX_CString& other) const;
117  bool operator>(const AAX_CString& other) const;
118  const char& operator[](uint32_t index) const;
119  char& operator[](uint32_t index);
120  AAX_CString& operator+=(const AAX_CString& str);
121  AAX_CString& operator+=(const char* str);
122 
123 protected:
124  std::string mString;
125 };
126 
127 
128 
129 #endif //AAX_CSTRING_H
virtual const char * Get() const
const char * CString() const
AAX_CString & Replace(uint32_t pos, uint32_t n, const AAX_CString &str)
uint32_t FindLast(const AAX_CString &findStr) const
std::string mString
Definition: AAX_CString.h:124
static const uint32_t kInvalidIndex
Definition: AAX_CString.h:38
AAX_CString & Erase(uint32_t pos, uint32_t n)
uint32_t FindFirst(const AAX_CString &findStr) const
AAX_CString & InsertNumber(uint32_t pos, double number, int32_t precision)
virtual AAX_IString & operator=(const AAX_IString &iOther)
AAX_CString & AppendNumber(double number, int32_t precision)
bool ToDouble(double *oValue) const
bool Empty() const
friend std::ostream & operator<<(std::ostream &os, const AAX_CString &str)
static const uint32_t kMaxStringLength
Definition: AAX_CString.h:39
bool operator!=(const AAX_CString &other) const
An AAX string interface.
A simple string container that can be passed across a binary boundary. This class, for simplicity, is not versioned and thus can never change.
Definition: AAX_IString.h:40
bool operator>(const AAX_CString &other) const
AAX_CString & operator+=(const AAX_CString &str)
std::string & StdString()
virtual uint32_t MaxLength() const
A generic AAX string class with similar functionality to std::string.
Definition: AAX_CString.h:35
friend std::istream & operator>>(std::istream &os, AAX_CString &str)
void Clear()
AAX_CString & Append(const AAX_CString &str)
virtual uint32_t Length() const
const char & operator[](uint32_t index) const
void SubString(uint32_t pos, uint32_t n, AAX_IString *outputStr) const
bool operator<(const AAX_CString &other) const
virtual void Set(const char *iString)
bool operator==(const AAX_CString &other) const
AAX_CString & Insert(uint32_t pos, const AAX_CString &str)
bool ToInteger(int32_t *oValue) const