String.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Util/DynamicArray.h>
  7. #include <AnKi/Util/Array.h>
  8. #include <AnKi/Util/Hash.h>
  9. #include <AnKi/Util/Forward.h>
  10. #include <cstring>
  11. #include <cstdio>
  12. #include <cctype>
  13. #include <cinttypes> // For PRId8 etc
  14. #include <cstdarg> // For var args
  15. #include <cstdlib>
  16. namespace anki {
  17. /// @addtogroup util_private
  18. /// @{
  19. namespace detail {
  20. template<typename TNumber>
  21. constexpr const char* toStringFormat()
  22. {
  23. return nullptr;
  24. }
  25. #define ANKI_DEPLOY_TO_STRING(type_, string_) \
  26. template<> \
  27. constexpr const char* toStringFormat<type_>() \
  28. { \
  29. return string_; \
  30. }
  31. ANKI_DEPLOY_TO_STRING(I8, "%" PRId8)
  32. ANKI_DEPLOY_TO_STRING(I16, "%" PRId16)
  33. ANKI_DEPLOY_TO_STRING(I32, "%" PRId32)
  34. ANKI_DEPLOY_TO_STRING(I64, "%" PRId64)
  35. ANKI_DEPLOY_TO_STRING(U8, "%" PRIu8)
  36. ANKI_DEPLOY_TO_STRING(U16, "%" PRIu16)
  37. ANKI_DEPLOY_TO_STRING(U32, "%" PRIu32)
  38. ANKI_DEPLOY_TO_STRING(U64, "%" PRIu64)
  39. ANKI_DEPLOY_TO_STRING(F32, "%f")
  40. ANKI_DEPLOY_TO_STRING(F64, "%f")
  41. #undef ANKI_DEPLOY_TO_STRING
  42. } // end namespace detail
  43. /// @}
  44. /// @addtogroup util_containers
  45. /// @{
  46. /// A wrapper on top of C strings. Used mainly for safety.
  47. class CString
  48. {
  49. public:
  50. using Char = char;
  51. static constexpr PtrSize kNpos = kMaxPtrSize;
  52. CString() = default;
  53. constexpr CString(const Char* ptr)
  54. : m_ptr(ptr)
  55. {
  56. }
  57. /// Copy constructor.
  58. constexpr CString(const CString& b)
  59. : m_ptr(b.m_ptr)
  60. {
  61. }
  62. /// Copy.
  63. constexpr CString& operator=(const CString& b)
  64. {
  65. m_ptr = b.m_ptr;
  66. return *this;
  67. }
  68. /// Return true if the string is initialized.
  69. explicit operator Bool() const
  70. {
  71. return !isEmpty();
  72. }
  73. /// Return char at the specified position.
  74. template<typename T>
  75. const Char& operator[](T pos) const
  76. {
  77. checkInit();
  78. ANKI_ASSERT(pos >= 0 && U32(pos) <= getLength());
  79. return m_ptr[pos];
  80. }
  81. Bool operator==(const CString& b) const
  82. {
  83. if(m_ptr == nullptr || b.m_ptr == nullptr)
  84. {
  85. return m_ptr == b.m_ptr;
  86. }
  87. else
  88. {
  89. return std::strcmp(m_ptr, b.m_ptr) == 0;
  90. }
  91. }
  92. Bool operator!=(const CString& b) const
  93. {
  94. return !((*this) == b);
  95. }
  96. Bool operator<(const CString& b) const
  97. {
  98. if(m_ptr == nullptr || b.m_ptr == nullptr)
  99. {
  100. return false;
  101. }
  102. else
  103. {
  104. return std::strcmp(m_ptr, b.m_ptr) < 0;
  105. }
  106. }
  107. Bool operator<=(const CString& b) const
  108. {
  109. if(m_ptr == nullptr || b.m_ptr == nullptr)
  110. {
  111. return m_ptr == b.m_ptr;
  112. }
  113. else
  114. {
  115. return std::strcmp(m_ptr, b.m_ptr) <= 0;
  116. }
  117. }
  118. Bool operator>(const CString& b) const
  119. {
  120. if(m_ptr == nullptr || b.m_ptr == nullptr)
  121. {
  122. return false;
  123. }
  124. else
  125. {
  126. return std::strcmp(m_ptr, b.m_ptr) > 0;
  127. }
  128. }
  129. Bool operator>=(const CString& b) const
  130. {
  131. if(m_ptr == nullptr || b.m_ptr == nullptr)
  132. {
  133. return m_ptr == b.m_ptr;
  134. }
  135. else
  136. {
  137. return std::strcmp(m_ptr, b.m_ptr) >= 0;
  138. }
  139. }
  140. /// Get C-string.
  141. const Char* cstr() const
  142. {
  143. return (m_ptr) ? m_ptr : "";
  144. }
  145. const Char* getBegin() const
  146. {
  147. checkInit();
  148. return &m_ptr[0];
  149. }
  150. const Char* getEnd() const
  151. {
  152. checkInit();
  153. return &m_ptr[getLength()];
  154. }
  155. const Char* begin() const
  156. {
  157. return getBegin();
  158. }
  159. const Char* end() const
  160. {
  161. return getEnd();
  162. }
  163. /// Return true if the string is not initialized.
  164. Bool isEmpty() const
  165. {
  166. return m_ptr == nullptr || getLength() == 0;
  167. }
  168. /// Get the string length.
  169. U32 getLength() const
  170. {
  171. return (m_ptr == nullptr) ? 0 : U32(std::strlen(m_ptr));
  172. }
  173. /// Find a substring of this string.
  174. /// @param[in] cstr The substring to search.
  175. /// @param position Position of the first character in the string to be considered in the search.
  176. /// @return A valid position if the string is found or kNpos if not found.
  177. PtrSize find(const CString& cstr, PtrSize position = 0) const
  178. {
  179. checkInit();
  180. ANKI_ASSERT(position < getLength());
  181. const Char* out = std::strstr(m_ptr + position, &cstr[0]);
  182. return (out == nullptr) ? kNpos : PtrSize(out - m_ptr);
  183. }
  184. /// Convert to F16.
  185. Error toNumber(F16& out) const;
  186. /// Convert to F32.
  187. Error toNumber(F32& out) const;
  188. /// Convert to F64.
  189. Error toNumber(F64& out) const;
  190. /// Convert to I8.
  191. Error toNumber(I8& out) const;
  192. /// Convert to U8.
  193. Error toNumber(U8& out) const;
  194. /// Convert to I16.
  195. Error toNumber(I16& out) const;
  196. /// Convert to U16.
  197. Error toNumber(U16& out) const;
  198. /// Convert to I32.
  199. Error toNumber(I32& out) const;
  200. /// Convert to U32.
  201. Error toNumber(U32& out) const;
  202. /// Convert to I64.
  203. Error toNumber(I64& out) const;
  204. /// Convert to U64.
  205. Error toNumber(U64& out) const;
  206. /// Convert to Bool.
  207. Error toNumber(Bool& out) const;
  208. /// Compute the hash.
  209. U64 computeHash() const
  210. {
  211. checkInit();
  212. return anki::computeHash(m_ptr, getLength());
  213. }
  214. void toWideChars(WChar* arr, U32 arrSize) const
  215. {
  216. checkInit();
  217. const U32 len = getLength();
  218. ANKI_ASSERT(arrSize >= len + 1);
  219. if(len > 0)
  220. {
  221. [[maybe_unused]] const PtrSize charsWritten = mbstowcs(arr, m_ptr, arrSize);
  222. ANKI_ASSERT(charsWritten == len + 1);
  223. }
  224. else
  225. {
  226. *arr = L'\0';
  227. }
  228. }
  229. private:
  230. const Char* m_ptr = nullptr;
  231. void checkInit() const
  232. {
  233. ANKI_ASSERT(m_ptr != nullptr);
  234. }
  235. };
  236. /// Compare function for CStrings. Can be used in HashMap.
  237. class CStringCompare
  238. {
  239. public:
  240. Bool operator()(CString a, CString b)
  241. {
  242. return a == b;
  243. }
  244. };
  245. /// The base class for strings.
  246. template<typename TMemoryPool>
  247. class BaseString
  248. {
  249. template<typename>
  250. friend class BaseStringList;
  251. public:
  252. using Char = char; ///< Character type
  253. using Iterator = Char*;
  254. using ConstIterator = const Char*;
  255. using MemoryPool = TMemoryPool;
  256. static constexpr PtrSize kNpos = kMaxPtrSize;
  257. /// Default ctor.
  258. BaseString(const MemoryPool& pool = MemoryPool())
  259. : m_data(pool)
  260. {
  261. }
  262. /// Copy ctor.
  263. BaseString(const BaseString& b)
  264. {
  265. *this = b;
  266. }
  267. /// Copy ctor.
  268. BaseString(CString str, const MemoryPool& pool = MemoryPool())
  269. : m_data(pool)
  270. {
  271. *this = str;
  272. }
  273. /// Copy ctor.
  274. BaseString(const Char* str, const MemoryPool& pool = MemoryPool())
  275. : BaseString(CString(str), pool)
  276. {
  277. }
  278. /// Move ctor.
  279. BaseString(BaseString&& b)
  280. : m_data(std::move(b.m_data))
  281. {
  282. }
  283. /// Initialize using a range. Copies the range of [first, last)
  284. BaseString(ConstIterator first, ConstIterator last, const MemoryPool& pool = MemoryPool())
  285. : m_data(pool)
  286. {
  287. ANKI_ASSERT(first != nullptr && last != nullptr);
  288. for(ConstIterator it = first; it < last; ++it)
  289. {
  290. ANKI_ASSERT(*it != '\0');
  291. }
  292. const PtrSize length = last - first;
  293. m_data.resize(length + 1);
  294. memcpy(&m_data[0], first, length);
  295. m_data[length] = '\0';
  296. }
  297. /// Initialize using a character.
  298. BaseString(Char c, PtrSize length, const MemoryPool& pool = MemoryPool())
  299. : m_data(pool)
  300. {
  301. ANKI_ASSERT(c != '\0');
  302. m_data.resize(length + 1);
  303. memset(&m_data[0], c, length);
  304. m_data[length] = '\0';
  305. }
  306. ~BaseString() = default;
  307. /// Move.
  308. BaseString& operator=(BaseString&& b)
  309. {
  310. m_data = std::move(b.m_data);
  311. return *this;
  312. }
  313. /// Copy.
  314. BaseString& operator=(const BaseString& b)
  315. {
  316. m_data = b.m_data;
  317. return *this;
  318. }
  319. /// Copy.
  320. BaseString& operator=(const Char* b)
  321. {
  322. *this = CString(b);
  323. return *this;
  324. }
  325. /// Copy.
  326. BaseString& operator=(CString str)
  327. {
  328. const U32 len = str.getLength();
  329. if(len > 0)
  330. {
  331. m_data.resize(len + 1);
  332. memcpy(&m_data[0], &str[0], sizeof(Char) * (len + 1));
  333. }
  334. else
  335. {
  336. m_data.destroy();
  337. }
  338. return *this;
  339. }
  340. /// Return char at the specified position.
  341. template<typename TInt>
  342. const Char& operator[](TInt pos) const
  343. {
  344. return m_data[pos];
  345. }
  346. /// Return char at the specified position as a modifiable reference.
  347. template<typename TInt>
  348. Char& operator[](TInt pos)
  349. {
  350. return m_data[pos];
  351. }
  352. explicit operator Bool() const
  353. {
  354. return !isEmpty();
  355. }
  356. Bool operator==(CString b) const
  357. {
  358. return toCString() == b;
  359. }
  360. Bool operator!=(CString b) const
  361. {
  362. return !(*this == b);
  363. }
  364. Bool operator<(CString b) const
  365. {
  366. return toCString() < b;
  367. }
  368. Bool operator<=(CString b) const
  369. {
  370. return toCString() < b;
  371. }
  372. Bool operator>(CString b) const
  373. {
  374. return toCString() > b;
  375. }
  376. Bool operator>=(CString b) const
  377. {
  378. return toCString() >= b;
  379. }
  380. /// Append another string to this one.
  381. BaseString& operator+=(CString b)
  382. {
  383. if(!b.isEmpty())
  384. {
  385. appendInternal(&b[0], b.getLength());
  386. }
  387. return *this;
  388. }
  389. BaseString operator+(CString b) const
  390. {
  391. BaseString out = *this;
  392. if(!b.isEmpty())
  393. {
  394. out.appendInternal(&b[0], b.getLength());
  395. }
  396. return out;
  397. }
  398. operator CString() const
  399. {
  400. return toCString();
  401. }
  402. /// Get a C string.
  403. const Char* cstr() const
  404. {
  405. return toCString().cstr();
  406. }
  407. /// Append using a range. Copies the range of [first, oneAfterLast)
  408. BaseString& append(ConstIterator first, ConstIterator oneAfterLast)
  409. {
  410. const PtrSize len = oneAfterLast - first;
  411. appendInternal(first, len);
  412. return *this;
  413. }
  414. /// Create formated string.
  415. ANKI_CHECK_FORMAT(1, 2)
  416. BaseString& sprintf(const Char* fmt, ...)
  417. {
  418. ANKI_ASSERT(fmt);
  419. va_list args;
  420. va_start(args, fmt);
  421. sprintfInternal(fmt, args);
  422. va_end(args);
  423. return *this;
  424. }
  425. /// Destroy the string.
  426. void destroy()
  427. {
  428. m_data.destroy();
  429. }
  430. Iterator getBegin()
  431. {
  432. ANKI_ASSERT(!isEmpty());
  433. return &m_data[0];
  434. }
  435. ConstIterator getBegin() const
  436. {
  437. ANKI_ASSERT(!isEmpty());
  438. return &m_data[0];
  439. }
  440. Iterator getEnd()
  441. {
  442. ANKI_ASSERT(!isEmpty());
  443. return &m_data[m_data.getSize() - 1];
  444. }
  445. ConstIterator getEnd() const
  446. {
  447. ANKI_ASSERT(!isEmpty());
  448. return &m_data[m_data.getSize() - 1];
  449. }
  450. Iterator begin()
  451. {
  452. return getBegin();
  453. }
  454. ConstIterator begin() const
  455. {
  456. return getBegin();
  457. }
  458. Iterator end()
  459. {
  460. return getEnd();
  461. }
  462. ConstIterator end() const
  463. {
  464. return getEnd();
  465. }
  466. /// Return the string's length. It doesn't count the terminating character.
  467. U32 getLength() const
  468. {
  469. return (m_data.getSize() == 0) ? 0 : U32(std::strlen(&m_data[0]));
  470. }
  471. /// Return the CString.
  472. CString toCString() const
  473. {
  474. return (!isEmpty()) ? CString(&m_data[0]) : CString();
  475. }
  476. /// Return true if it's empty.
  477. Bool isEmpty() const
  478. {
  479. return m_data.isEmpty();
  480. }
  481. /// Find a substring of this string.
  482. /// @param[in] cstr The substring to search.
  483. /// @param position Position of the first character in the string to be considered in the search.
  484. /// @return A valid position if the string is found or kNpos if not found.
  485. PtrSize find(const CString& cstr, PtrSize position = 0) const
  486. {
  487. ANKI_ASSERT(!isEmpty());
  488. return toCString().find(cstr, position);
  489. }
  490. /// Find a substring of this string.
  491. /// @param[in] str The substring to search.
  492. /// @param position Position of the first character in the string to be considered in the search.
  493. /// @return A valid position if the string is found or kNpos if not found.
  494. PtrSize find(const BaseString& str, PtrSize position) const
  495. {
  496. ANKI_ASSERT(!isEmpty());
  497. return find(str.toCString(), position);
  498. }
  499. /// Convert a number to a string.
  500. template<typename TNumber>
  501. void toString(TNumber number)
  502. {
  503. destroy();
  504. Array<Char, 512> buff;
  505. const I ret = std::snprintf(&buff[0], buff.size(), detail::toStringFormat<TNumber>(), number);
  506. if(ret < 0 || ret > I(buff.getSize()))
  507. {
  508. ANKI_UTIL_LOGF("To small intermediate buffer");
  509. }
  510. else
  511. {
  512. *this = CString(&buff[0]);
  513. }
  514. }
  515. /// Convert to F16.
  516. Error toNumber(F16& out) const
  517. {
  518. return toCString().toNumber(out);
  519. }
  520. /// Convert to F32.
  521. Error toNumber(F32& out) const
  522. {
  523. return toCString().toNumber(out);
  524. }
  525. /// Convert to F64.
  526. Error toNumber(F64& out) const
  527. {
  528. return toCString().toNumber(out);
  529. }
  530. /// Convert to I8.
  531. Error toNumber(I8& out) const
  532. {
  533. return toCString().toNumber(out);
  534. }
  535. /// Convert to U8.
  536. Error toNumber(U8& out) const
  537. {
  538. return toCString().toNumber(out);
  539. }
  540. /// Convert to I16.
  541. Error toNumber(I16& out) const
  542. {
  543. return toCString().toNumber(out);
  544. }
  545. /// Convert to U16.
  546. Error toNumber(U16& out) const
  547. {
  548. return toCString().toNumber(out);
  549. }
  550. /// Convert to I32.
  551. Error toNumber(I32& out) const
  552. {
  553. return toCString().toNumber(out);
  554. }
  555. /// Convert to U32.
  556. Error toNumber(U32& out) const
  557. {
  558. return toCString().toNumber(out);
  559. }
  560. /// Convert to I64.
  561. Error toNumber(I64& out) const
  562. {
  563. return toCString().toNumber(out);
  564. }
  565. /// Convert to U64.
  566. Error toNumber(U64& out) const
  567. {
  568. return toCString().toNumber(out);
  569. }
  570. /// Convert to Bool.
  571. Error toNumber(Bool& out) const
  572. {
  573. return toCString().toNumber(out);
  574. }
  575. /// Compute the hash.
  576. U64 computeHash() const
  577. {
  578. ANKI_ASSERT(!isEmpty());
  579. return anki::computeHash(&m_data[0], m_data.getSize());
  580. }
  581. /// Replace all occurrences of "from" with "to".
  582. BaseString& replaceAll(CString from, CString to)
  583. {
  584. BaseString tmp(toCString(), getMemoryPool());
  585. const PtrSize fromLen = from.getLength();
  586. const PtrSize toLen = to.getLength();
  587. PtrSize pos = kNpos;
  588. while((pos = tmp.find(from)) != kNpos)
  589. {
  590. BaseString tmp2(getMemoryPool());
  591. if(pos > 0)
  592. {
  593. tmp2.append(tmp.getBegin(), tmp.getBegin() + pos);
  594. }
  595. if(toLen > 0)
  596. {
  597. tmp2.append(to.getBegin(), to.getBegin() + toLen);
  598. }
  599. if(pos + fromLen < tmp.getLength())
  600. {
  601. tmp2.append(tmp.getBegin() + pos + fromLen, tmp.getEnd());
  602. }
  603. tmp.destroy();
  604. tmp = std::move(tmp2);
  605. }
  606. destroy();
  607. *this = std::move(tmp);
  608. return *this;
  609. }
  610. /// @brief Execute a functor for all characters of the string.
  611. template<typename TFunc>
  612. BaseString& transform(TFunc func)
  613. {
  614. U i = 0;
  615. while(i < m_data.getSize() && m_data[i] != '\0')
  616. {
  617. func(m_data[i]);
  618. ++i;
  619. }
  620. return *this;
  621. }
  622. BaseString& toLower()
  623. {
  624. return transform([](Char& c) {
  625. c = Char(tolower(c));
  626. });
  627. }
  628. TMemoryPool& getMemoryPool()
  629. {
  630. return m_data.getMemoryPool();
  631. }
  632. private:
  633. DynamicArray<Char, TMemoryPool, PtrSize> m_data;
  634. /// Append to this string.
  635. void appendInternal(const Char* str, PtrSize strLen)
  636. {
  637. ANKI_ASSERT(str != nullptr);
  638. ANKI_ASSERT(strLen > 0);
  639. auto size = m_data.getSize();
  640. // Fix empty string
  641. if(size == 0)
  642. {
  643. size = 1;
  644. }
  645. m_data.resize(size + strLen);
  646. memcpy(&m_data[size - 1], str, sizeof(Char) * strLen);
  647. m_data[m_data.getSize() - 1] = '\0';
  648. }
  649. /// Internal don't use it.
  650. void sprintfInternal(const Char* fmt, va_list& args)
  651. {
  652. Array<Char, 512> buffer;
  653. va_list args2;
  654. va_copy(args2, args); // vsnprintf will alter "args". Copy it case we need to call vsnprintf in the else bellow
  655. I len = std::vsnprintf(&buffer[0], sizeof(buffer), fmt, args);
  656. if(len < 0)
  657. {
  658. ANKI_UTIL_LOGF("vsnprintf() failed");
  659. }
  660. else if(PtrSize(len) >= sizeof(buffer))
  661. {
  662. I size = len + 1;
  663. m_data.resize(size);
  664. len = std::vsnprintf(&m_data[0], size, fmt, args2);
  665. ANKI_ASSERT((len + 1) == size);
  666. }
  667. else
  668. {
  669. // buffer was enough
  670. *this = CString(&buffer[0]);
  671. }
  672. va_end(args2);
  673. }
  674. };
  675. using String = BaseString<SingletonMemoryPoolWrapper<DefaultMemoryPool>>;
  676. #define ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, op, ...) \
  677. __VA_ARGS__ \
  678. inline Bool operator op(TypeA a, TypeB b) \
  679. { \
  680. return CString(a) op CString(b); \
  681. }
  682. #define ANKI_STRING_COMPARE_OPS(TypeA, TypeB, ...) \
  683. ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, ==, __VA_ARGS__) \
  684. ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, !=, __VA_ARGS__) \
  685. ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, <, __VA_ARGS__) \
  686. ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, <=, __VA_ARGS__) \
  687. ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, >, __VA_ARGS__) \
  688. ANKI_STRING_COMPARE_OPERATOR(TypeA, TypeB, >=, __VA_ARGS__)
  689. ANKI_STRING_COMPARE_OPS(const Char*, CString, )
  690. ANKI_STRING_COMPARE_OPS(const Char*, const BaseString<TMemPool>&, template<typename TMemPool>)
  691. ANKI_STRING_COMPARE_OPS(const BaseString<TMemPool>&, const Char*, template<typename TMemPool>)
  692. ANKI_STRING_COMPARE_OPS(CString, const BaseString<TMemPool>&, template<typename TMemPool>)
  693. ANKI_STRING_COMPARE_OPS(const BaseString<TMemPool>&, const BaseString<TMemPool>&, template<typename TMemPool>)
  694. #undef ANKI_STRING_COMPARE_OPERATOR
  695. #undef ANKI_STRING_COMPARE_OPS
  696. /// @}
  697. } // end namespace anki