7#include "Arp/Base/Core/Detail/BasicString.hxx"
8#include "Arp/Base/Core/Detail/BasicString.inl"
11#define ARP_BUILD_STRING_IMPL_INLINE
13#ifdef ARP_BUILD_STRING_IMPL_INLINE
14 #define ARP_STRING_INLINE inline
15 #define ARP_STRING_EXPORT inline
16 #define ARP_STRING_EXPORT_DECL
18 #define ARP_STRING_INLINE
19 #define ARP_STRING_EXPORT ARP_EXPORT
20 #define ARP_STRING_EXPORT_DECL ARP_EXPORT
23namespace Arp {
namespace Base {
namespace Core
49 using Iterator =
typename BaseString::iterator;
55 using Bytes = std::vector<byte>;
64 using pointer =
typename AllocatorTraits::pointer;
66 using iterator =
typename BaseString::iterator;
88 String(std::initializer_list<CharType> arg);
91 explicit String(
const Bytes& bytes);
96 static const String NewLine;
103 String& operator=(std::initializer_list<CharType> right);
108 String& operator+=(std::initializer_list<CharType> right);
118 String& Assign(std::initializer_list<CharType> arg);
181 void ShrinkToFit(
void);
210 bool IsEmpty(
void)
const;
243 bool StartsWith(
const CharType* pChars)
const;
244 bool StartsWith(
const String& pattern)
const;
245 bool EndsWith(
const CharType* pChars)
const;
246 bool EndsWith(
const String& pattern)
const;
249 int Compare(
const String& other)
const;
252 int Compare(
const CharType* pOther)
const;
263 Bytes ToBytes(
void)
const;
265 const StdString& GetStdString(
void)
const;
269 String TrimLeft(
void)
const;
271 String TrimRight(
void)
const;
277 Tokens Split(
CharType delimiter,
bool trimTokens =
true,
bool removeEmptyTokens =
true)
const;
278 Tokens Split(std::span<const CharType> delimiters,
bool trimTokens =
true,
bool removeEmptyTokens =
true)
const;
279 Tokens SplitByWord(
const String& delimiter,
bool trimTokens =
true,
bool removeEmptyTokens =
true)
const;
282 template<
typename... Args>
static String Format(
const String& format,
const Args& ... args);
283 template<
typename... Args>
static String Format(
const char* format,
const Args& ... args);
284 template<
typename... Args>
static String FormatPrintf(
const char* format,
const Args& ... args);
287 friend ARP_STRING_EXPORT_DECL
String operator+(
const String& left,
const String& right);
302 const
StdString& GetBaseString(
void)const;
304 bool StartWith(const
CharType* pChars)const;
306 bool StartWith(const
String& pattern)const;
308 bool EndWith(const
CharType* pChars)const;
310 bool EndWith(const
String& pattern)const;
323ARP_STRING_EXPORT_DECL
std::ostream& operator<<(
std::ostream& os, const
String& right);
324ARP_STRING_EXPORT_DECL
std::istream& operator>>(
std::istream& is,
String& right);
339ARP_STRING_EXPORT_DECL
bool operator==(const
String& left, const
String& right);
354ARP_STRING_EXPORT_DECL
void swap(
String& left,
String& right)noexcept;
359#include "Arp/Base/Core/Detail/String.inl"
361#ifdef ARP_BUILD_STRING_IMPL_INLINE
typename StdString::difference_type difference_type
The difference type of this type.
Definition: BasicString.hxx:56
typename StdString::reverse_iterator reverse_iterator
The reverse iterator type of this type.
Definition: BasicString.hxx:63
typename StdString::const_reverse_iterator const_reverse_iterator
The const reverse iterator type of this type.
Definition: BasicString.hxx:64
typename StdString::const_reference const_reference
The const reference type of this type.
Definition: BasicString.hxx:58
typename StdString::reference reference
The reference type of this type.
Definition: BasicString.hxx:57
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
typename BaseString::const_iterator const_iterator
The const iterator type of this type.
Definition: String.hpp:67
String(String &&arg) noexcept
This move constructor moves the as argument passed string to this string.
typename AllocatorTraits::pointer pointer
The pointer type of this type.
Definition: String.hpp:64
typename BaseString::difference_type difference_type
The difference type of this type.
Definition: String.hpp:61
Allocator allocator_type
The allocator type of this type.
Definition: String.hpp:58
decltype(StdString()<=> StdString()) ThreeWayCompareResult
Used by operator<=>
Definition: String.hpp:53
typename AllocatorTraits::const_pointer const_pointer
The const pointer type of this type.
Definition: String.hpp:65
String & operator=(String &&arg) noexcept
This move assignment operator moves the right-hand-side operand to this string.
typename BaseString::const_reference const_reference
The const reference type of this type.
Definition: String.hpp:63
typename BaseString::const_iterator ConstIterator
The const iterator type of this type.
Definition: String.hpp:50
typename BaseString::const_reference ConstReference
The const reference type of this type.
Definition: String.hpp:48
typename BaseString::iterator iterator
The iterator type of this type.
Definition: String.hpp:66
typename BaseString::iterator Iterator
The iterator type of this type.
Definition: String.hpp:49
typename BaseString::reverse_iterator reverse_iterator
The reverse iterator type of this type.
Definition: String.hpp:68
std::allocator_traits< Allocator > AllocatorTraits
The allocator traits type.
Definition: String.hpp:43
BaseString::StdString StdString
The type of the basic std string.
Definition: String.hpp:46
std::allocator< CharType > Allocator
The characters allocator type.
Definition: String.hpp:42
typename BaseString::const_reverse_iterator const_reverse_iterator
The const reverse iterator type of this type.
Definition: String.hpp:69
std::vector< String > Tokens
Used by initializing operations.
Definition: String.hpp:54
CharType value_type
The char type of this type.
Definition: String.hpp:59
typename BaseString::reference reference
The reference type of this type.
Definition: String.hpp:62
String(void)
The default constructor constructs an empty string instance.
String(const String &arg)
The copy constructor copies the as argument passed string deeply.
typename BaseString::reference Reference
The reference type of this type.
Definition: String.hpp:47
Arp::Base::Core::char8u Char8uType
The UTF8 character type.
Definition: String.hpp:44
typename BaseString::size_type size_type
The size type of this type.
Definition: String.hpp:60
~String(void)
The destructor deallocates all memory of this instance.
typename BaseString::reverse_iterator ReverseIterator
The reverse iterator type of this type.
Definition: String.hpp:51
typename BaseString::const_reverse_iterator ConstReverseIterator
Used by Split() operations.
Definition: String.hpp:52
String & operator=(const String &arg)
This assignment operator copies the right-hand-side operand to this string.
char CharType
The character type.
Definition: String.hpp:41
char8_t char8u
The Arp UTF8 character type of 1 byte size.
Definition: PrimitiveTypes.hpp:47
@ Empty
No sink assigned to session yet.
@ Append
Opens the file if it exists and seeks to the end. Otherwise, creates a new file.
Root namespace for the PLCnext API
class ARP_DEPRECATED("Use Arp::Enum<T> instead.") EnumStrings
Deprecated! The class implements an adapter for enums to define the string literals of the enum entri...
Definition: EnumStrings.hxx:38
Namespace of the C++ standard library