15 #ifndef Om_Language_DefaultAtom_
23 #ifndef Om_Macro_Precompilation_
25 #include "boost/locale/conversion.hpp"
32 template <typename ThisImplementation>
35 Om::Language::DefaultAtom<ThisImplementation>
40 inline Type_::~DefaultAtom() {}
43 inline bool Type_::operator <(DefaultAtom
const & theAtom) {
44 return this->thisString < theAtom.thisString;
48 inline void Type_::Clear() {
49 this->thisString.clear();
53 inline bool Type_::Equals(DefaultAtom
const & theAtom)
const {
54 return this->thisString == theAtom.thisString;
58 inline bool Type_::Equals(ThisImplementation
const & theAtom)
const {
60 static_cast<DefaultAtom
const &
>(theAtom)
67 > Type_::GetElementRange() {
77 return this->DefaultElement<
86 > Type_::GetElementRange()
const {
96 return this->DefaultElement<
103 inline std::string
const & Type_::GetString()
const {
104 return this->thisString;
108 inline bool Type_::IsEmpty()
const {
109 return this->thisString.empty();
113 inline bool Type_::Merge(ThisImplementation & theAtom) {
114 this->TakeElement(theAtom);
119 inline bool Type_::Merge(ThisImplementation
const & theAtom) {
120 this->TakeElement(theAtom);
125 inline void Type_::Swap(ThisImplementation & theAtom) {
126 this->thisString.swap(theAtom.thisString);
132 inline Type_::DefaultAtom():
136 inline Type_::DefaultAtom(
137 char const theCodeUnitIterator[]
139 thisString(theCodeUnitIterator) {
141 theCodeUnitIterator &&
142 "The argument cannot be null."
145 boost::locale::normalize(
147 boost::locale::norm_nfd
148 ) == this->thisString &&
149 "The string must be NFD-normalized."
154 inline Type_::DefaultAtom(
char const theCodeUnit):
160 boost::locale::normalize(
162 boost::locale::norm_nfd
163 ) == this->thisString &&
164 "The code unit must be NFD-normalized."
174 template <typename TheImplementation>
177 Om::Language::DefaultAtom<TheImplementation>
181 Type_
const & theFirst,
182 Type_
const & theSecond
184 return theFirst.Equals(theSecond);
189 Type_
const & theFirst,
190 Type_
const & theSecond
192 return !theFirst.Equals(theSecond);
Any object that items can be pulled from.
bool operator!=(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)
bool operator==(DefaultAtom< TheImplementation > const &, DefaultAtom< TheImplementation > const &)