Unicode character string. More...
Public Member Functions | |
| String () | |
| Creates a null string. | |
| String (const char *str) | |
| Creates a string from str in UTF-8 encoding. | |
| String (char *str) | |
| Creates a string from str in UTF-8 encoding. | |
| String (const char *str, bool do_alloc) | |
| Creates a string from str in UTF-8 encoding. | |
| String (const char *str, Integer len) | |
| Creates a string from str in UTF-8 encoding. | |
| String (std::string_view str) | |
| Creates a string from str in UTF-8 encoding. | |
| String (StringView str) | |
| Creates a string from str in UTF-8 encoding. | |
| String (const std::string &str) | |
| Creates a string from str in UTF-8 encoding. | |
| String (const UCharConstArrayView &ustr) | |
| Creates a string from str in UTF-16 encoding. | |
| String (const Span< const Byte > &ustr) | |
| Creates a string from str in UTF-8 encoding. | |
| String (StringImpl *impl) | |
| Creates a string from str in UTF-8 encoding. | |
| String (const String &str) | |
| Creates a string from str. | |
| String (String &&str) | |
| Creates a string from str. | |
| String & | operator= (const String &str) |
| Copies str into this instance. | |
| String & | operator= (String &&str) |
| Copies str into this instance. | |
| String & | operator= (StringView str) |
| Copies str into this instance. | |
| String & | operator= (const char *str) |
| References str encoded in UTF-8 in this instance. | |
| String & | operator= (std::string_view str) |
| Copies str encoded in UTF-8 into this instance. | |
| String & | operator= (const std::string &str) |
| Copies str encoded in UTF-8 into this instance. | |
| ~String () | |
| Frees resources. | |
| operator StringView () const | |
| Returns a view of the current string. | |
| ConstArrayView< UChar > | utf16 () const |
| Returns the conversion of the instance into UTF-16 encoding. | |
| ByteConstArrayView | utf8 () const |
| Returns the conversion of the instance into UTF-8 encoding. | |
| Span< const Byte > | bytes () const |
| Returns the conversion of the instance into UTF-8 encoding. | |
| const char * | localstr () const |
| Returns the conversion of the instance into UTF-8 encoding. | |
| std::string_view | toStdStringView () const |
| Returns an STL view of the current string. | |
| StringView | view () const |
| Returns a view of the current string. | |
| String | clone () const |
| Clones this string. | |
| String | upper () const |
| Transforms all characters in the string to uppercase. | |
| String | lower () const |
| Transforms all characters in the string to lowercase. | |
| bool | null () const |
| Returns true if the string is null. | |
| Integer | len () const |
| Returns the length of the string in 32 bits. | |
| Int64 | length () const |
| Returns the length of the string. | |
| bool | empty () const |
| True if the string is empty (null or ""). | |
| Int32 | hashCode () const |
| Calculates a hash value for this character string. | |
| void | writeBytes (std::ostream &o) const |
| Writes the string in UTF-8 format to the stream o. | |
| String | operator+ (const char *str) const |
| String | operator+ (std::string_view str) const |
| String | operator+ (const std::string &str) const |
| String | operator+ (const String &str) const |
| String | operator+ (unsigned long v) const |
| String | operator+ (unsigned int v) const |
| String | operator+ (double v) const |
| String | operator+ (long double v) const |
| String | operator+ (int v) const |
| String | operator+ (long v) const |
| String | operator+ (unsigned long long v) const |
| String | operator+ (long long v) const |
| String | operator+ (const APReal &v) const |
| bool | contains (const String &s) const |
| Indicates if the string contains s. | |
| bool | startsWith (const String &s) const |
| Indicates if the string starts with the characters of s. | |
| bool | endsWith (const String &s) const |
| Indicates if the string ends with the characters of s. | |
| String | substring (Int64 pos) const |
| Substring starting at position pos. | |
| String | substring (Int64 pos, Int64 len) const |
| Substring starting at position pos and of length len. | |
| template<typename StringContainer> | |
| void | split (StringContainer &str_array, char c) const |
| Splits the string based on the character c. | |
| void | internalDump (std::ostream &ostr) const |
| Displays the internal information of the class. | |
Static Public Member Functions | |
| static String | fromUtf8 (Span< const Byte > bytes) |
| static String | replaceWhiteSpace (const String &rhs) |
| Performs whitespace character normalization. | |
| static String | collapseWhiteSpace (const String &rhs) |
| Performs whitespace character normalization. | |
| static String | fromNumber (unsigned long v) |
| static String | fromNumber (unsigned int v) |
| static String | fromNumber (double v) |
| static String | fromNumber (double v, Integer nb_digit_after_point) |
| static String | fromNumber (long double v) |
| static String | fromNumber (int v) |
| static String | fromNumber (long v) |
| static String | fromNumber (unsigned long long v) |
| static String | fromNumber (long long v) |
| static String | fromNumber (const APReal &v) |
| static String | format (const String &str) |
| static String | format (const String &str, const StringFormatterArg &arg1) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4, const StringFormatterArg &arg5) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4, const StringFormatterArg &arg5, const StringFormatterArg &arg6) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4, const StringFormatterArg &arg5, const StringFormatterArg &arg6, const StringFormatterArg &arg7) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4, const StringFormatterArg &arg5, const StringFormatterArg &arg6, const StringFormatterArg &arg7, const StringFormatterArg &arg8) |
| static String | format (const String &str, const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4, const StringFormatterArg &arg5, const StringFormatterArg &arg6, const StringFormatterArg &arg7, const StringFormatterArg &arg8, const StringFormatterArg &arg9) |
| static String | concat (const StringFormatterArg &arg1) |
| static String | concat (const StringFormatterArg &arg1, const StringFormatterArg &arg2) |
| static String | concat (const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3) |
| static String | concat (const StringFormatterArg &arg1, const StringFormatterArg &arg2, const StringFormatterArg &arg3, const StringFormatterArg &arg4) |
| static String | plural (const Integer n, const String &str, const bool with_number=true) |
| Standard plural form by adding an 's'. | |
| static String | plural (const Integer n, const String &str, const String &str2, const bool with_number=true) |
| Special plural form by variant. | |
| static String | join (String delim, ConstArrayView< String > strs) |
Private Member Functions | |
| void | _checkClone () const |
| bool | isLess (const String &s) const |
| String & | _append (const String &str) |
| std::string_view | _viewFromConstChar () const |
| void | _removeReference () |
| ConstArrayView< UChar > | _internalUtf16BE () const |
| void | _resetFields () |
| void | _copyFields (const String &str) |
| void | _removeReferenceIfNeeded () |
| Removes the reference to the implementation if it is not null. | |
| void | _removeImplReference () |
| Removes the reference to the implementation. | |
Private Attributes | |
| StringImpl * | m_p = nullptr |
| Class implementation. | |
| const char * | m_const_ptr = nullptr |
| Int64 | m_const_ptr_size = 0 |
| String length if constant (-1 otherwise). | |
Friends | |
| class | StringBuilder |
| class | StringUtilsImpl |
| bool | operator< (const String &a, const String &b) |
| bool | operator== (const String &a, const String &b) |
| Compares two unicode strings. | |
| bool | operator!= (const String &a, const String &b) |
| Compares two unicode strings. | |
| std::ostream & | operator<< (std::ostream &o, const String &str) |
| String output operator. | |
| std::istream & | operator>> (std::istream &o, String &str) |
| String input operator. | |
| bool | operator== (const char *a, const String &b) |
| Compares two unicode strings. | |
| bool | operator!= (const char *a, const String &b) |
| Compares two unicode strings. | |
| bool | operator== (const String &a, const char *b) |
| Compares two unicode strings. | |
| bool | operator!= (const String &a, const char *b) |
| Compares two unicode strings. | |
| String | operator+ (const char *a, const String &b) |
| Adds two strings. | |
| bool | operator< (const String &a, const String &b) |
Unicode character string.
This class allows managing a character string using either UTF-8 or UTF-16 encoding. Note that UTF-16 encoding is obsolete and will be removed in a later version when C++20 is available.
All methods using const char* as arguments assume that the encoding used is UTF-8.
Instances of this class are immutable.
This class is similar to std::string but with the following differences:
When C++20 is available, the String class will correspond to the std::optional<std::u8string> type.
For performance reasons, when building a string piece by piece, it is preferable to use the 'StringBuilder' class.
Definition at line 69 of file arccore/src/base/arccore/base/String.h.
|
inline |
Creates a null string.
Definition at line 80 of file arccore/src/base/arccore/base/String.h.
Referenced by clone(), collapseWhiteSpace(), contains(), endsWith(), lower(), operator!=, operator!=, operator!=, operator+, operator+(), operator+(), operator+(), operator+(), operator<<, operator=(), operator=(), operator=(), operator=(), operator=(), operator=(), operator==, operator==, operator==, operator>>, plural(), plural(), replaceWhiteSpace(), split(), startsWith(), String(), String(), substring(), substring(), and upper().
|
inline |
Creates a string from str in UTF-8 encoding.
Definition at line 89 of file arccore/src/base/arccore/base/String.h.
References m_const_ptr_size.
| Arcane::String::String | ( | char * | str | ) |
Creates a string from str in UTF-8 encoding.
Definition at line 127 of file String.cc.
References m_const_ptr_size, and m_p.
| Arcane::String::String | ( | const char * | str, |
| bool | do_alloc ) |
Creates a string from str in UTF-8 encoding.
Definition at line 138 of file String.cc.
References m_const_ptr_size, and m_p.
| Arcane::String::String | ( | const char * | str, |
| Integer | len ) |
Creates a string from str in UTF-8 encoding.
Definition at line 116 of file String.cc.
References len(), m_const_ptr_size, and m_p.
| Arcane::String::String | ( | std::string_view | str | ) |
Creates a string from str in UTF-8 encoding.
Definition at line 59 of file String.cc.
References m_const_ptr_size, and m_p.
| Arcane::String::String | ( | StringView | str | ) |
Creates a string from str in UTF-8 encoding.
Definition at line 70 of file String.cc.
References m_const_ptr_size, m_p, and toStdStringView().
| Arcane::String::String | ( | const std::string & | str | ) |
Creates a string from str in UTF-8 encoding.
Definition at line 48 of file String.cc.
References m_const_ptr_size, and m_p.
| Arcane::String::String | ( | const UCharConstArrayView & | ustr | ) |
Creates a string from str in UTF-16 encoding.
Definition at line 82 of file String.cc.
References m_const_ptr_size, and m_p.
Creates a string from str in UTF-8 encoding.
Definition at line 93 of file String.cc.
References m_const_ptr_size, and m_p.
|
explicit |
Creates a string from str in UTF-8 encoding.
Creates a string from str in UTF-8 encoding
Definition at line 104 of file String.cc.
References m_const_ptr_size, and m_p.
| Arcane::String::String | ( | const String & | str | ) |
Creates a string from str.
Definition at line 158 of file String.cc.
References m_const_ptr_size, m_p, and String().
|
inline |
Creates a string from str.
Definition at line 120 of file arccore/src/base/arccore/base/String.h.
References m_const_ptr_size, m_p, and String().
|
inline |
Frees resources.
Definition at line 158 of file arccore/src/base/arccore/base/String.h.
References _removeReferenceIfNeeded().
|
inlineprivate |
Definition at line 553 of file arccore/src/base/arccore/base/String.h.
|
private |
|
private |
Removes the reference to the implementation.
Definition at line 241 of file String.cc.
References m_p.
Referenced by _removeReferenceIfNeeded().
|
inlineprivate |
Removes the reference to the implementation if it is not null.
Definition at line 563 of file arccore/src/base/arccore/base/String.h.
References _removeImplReference(), and m_p.
Referenced by operator=(), operator=(), operator=(), and ~String().
|
inlineprivate |
Definition at line 547 of file arccore/src/base/arccore/base/String.h.
|
inlineprivate |
Definition at line 541 of file arccore/src/base/arccore/base/String.h.
Returns the conversion of the instance into UTF-8 encoding.
bytes().size() corresponds to the length of the character string but the returned view always contains a terminal '\0'.
Definition at line 292 of file String.cc.
References m_const_ptr_size, and m_p.
Referenced by Arcane::SubDomain::_printCPUAffinity(), Arcane::MshParallelMeshReader::_readAndCheck(), Arcane::VariableIOReaderMng::_readMetaData(), Arcane::ParameterList::addParameterLine(), Arcane::ParameterListWithCaseOption::addParameterLine(), endsWith(), hashCode(), Arcane::BasicSerializer::put(), Arcane::MeshReaderMng::readMesh(), Arcane::BasicSerializer::reserve(), startsWith(), writeBytes(), and Arcane::TraceMng::writeDirect().
| String Arcane::String::clone | ( | ) | const |
Clones this string.
Definition at line 413 of file String.cc.
Referenced by Arcane::TimeHistoryMngInternal::_addHistoryValue(), Arcane::TimeHistoryMngInternal::iterationsAndValues(), Arcane::ArcaneCurveWriter::writeCurve(), and Arcane::GnuplotTimeHistoryCurveWriter2::writeCurve().
Performs whitespace character normalization.
The behavior is identical to replaceWhiteSpace() plus:
Definition at line 453 of file String.cc.
References m_p, null(), and String().
Referenced by Arcane::CaseOptionMultiSimpleT< Arcane::Integer >::print().
|
static |
|
static |
|
static |
|
static |
| bool Arcane::String::contains | ( | const String & | s | ) | const |
Indicates if the string contains s.
Definition at line 1078 of file String.cc.
References null(), String(), and toStdStringView().
| bool Arcane::String::empty | ( | ) | const |
True if the string is empty (null or "").
Definition at line 316 of file String.cc.
References m_p.
Referenced by Arcane::VariableIOReaderMng::_checkHashFunction(), Arcane::dom::DOMImplementation::_load(), Arcane::LimaCutInfosReader::_readUniqueIndex(), Arcane::CaseOptions::_setMeshHandleAndCheckDisabled(), Arcane::SimpleTableInternalMng::addAverageColumn(), Arcane::SimpleTableInternalMng::addColumn(), Arcane::SimpleTableInternalMng::addColumn(), Arcane::SimpleTableInternalMng::addRow(), Arcane::SimpleTableInternalMng::addRow(), Arcane::ArcaneSession::build(), Arcane::MeshUtils::checkUniqueIdsHashCollective(), Arcane::ArcaneCaseMeshService::createMesh(), Arcane::SimpleTableInternalMng::editColumnName(), Arcane::SimpleTableInternalMng::editRowName(), Arcane::ArcaneMeshConverter::execute(), Arcane::ArcaneLauncher::init(), Arcane::Accelerator::Impl::RuntimeLoader::loadRuntime(), Arcane::ArcaneVerifierModule::onExit(), Arcane::LimaMeshReaderService::readMeshFromFile(), and Arcane::ArcaneLauncher::run().
| bool Arcane::String::endsWith | ( | const String & | s | ) | const |
Indicates if the string ends with the characters of s.
Definition at line 1094 of file String.cc.
References bytes(), Arcane::SpanImpl< T, SizeType, Extent >::data(), Arcane::SpanImpl< T, SizeType, Extent >::size(), and String().
Referenced by Arcane::LIBXML2_DOMWriter::DoIndentation(), Arcane::Platform::getLoadedSharedLibraryFullPath(), Arcane::MshMeshWriter::writeMesh(), Arcane::VtkLegacyMeshWriter::writeMeshToFile(), Arcane::VtuMeshWriter::writeMeshToFile(), and Arcane::XmfMeshWriter::writeMeshToFile().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| Int32 Arcane::String::hashCode | ( | ) | const |
Calculates a hash value for this character string.
Definition at line 734 of file String.cc.
References bytes(), and Arcane::SpanImpl< T, SizeType, Extent >::size().
| void Arcane::String::internalDump | ( | std::ostream & | ostr | ) | const |
|
private |
|
static |
| Integer Arcane::String::len | ( | ) | const |
Returns the length of the string in 32 bits.
Definition at line 329 of file String.cc.
References Arcane::arccoreCheckArraySize(), and toStdStringView().
Referenced by Arcane::dom::DOMImplementation::_load(), split(), String(), and substring().
| Int64 Arcane::String::length | ( | ) | const |
Returns the length of the string.
Definition at line 339 of file String.cc.
References toStdStringView().
Referenced by Arcane::TimeHistoryMngInternal::_dumpSummaryOfCurves(), Arcane::TimeHistoryMngInternal::_dumpSummaryOfCurvesLegacy(), Arcane::TimeHistoryMngInternal::dumpCurves(), Arcane::MessagePassing::namedBarrier(), Arcane::BasicSerializer::put(), Arcane::platform::raiseFloatingException(), split(), and substring().
| const char * Arcane::String::localstr | ( | ) | const |
Returns the conversion of the instance into UTF-8 encoding.
If null() is true, returns the empty string. Otherwise, this method is equivalent to calling bytes().data(). There is always a terminal '\0' at the end of the returned string.
Definition at line 228 of file String.cc.
References m_p.
Referenced by Arcane::Otf2LibWrapper::_buildOtf2ClockAndStringDefinition(), Arcane::VariableIOReaderMng::_checkHashFunction(), Arcane::mesh::ItemFamily::_cmpIVariablePtr(), Arcane::mesh::FaceUniqueIdBuilder::_computeFacesUniqueIdsParallelV1(), Arcane::TimeHistoryMngInternal::_dumpSummaryOfCurves(), Arcane::TimeHistoryMngInternal::_dumpSummaryOfCurvesLegacy(), Arcane::SimpleTableInternalComparator::_exploreColumn(), Arcane::SimpleTableInternalComparator::_exploreRows(), Arcane::TimeLoopMng::_extractModuleAndEntryPointName(), Arcane::dom::DOMImplementation::_load(), Arcane::MetisMeshPartitioner::_partitionMesh(), Arcane::VtkMeshIOService::_readFacesMesh(), Arcane::ItemTypeMng::_readTypes(), Arcane::LimaCutInfosReader::_readUniqueIndexFromXml(), Arcane::DumpWEnsight7::_saveGroup(), Arcane::VtkHdfV2DataWriter::_writeDataSetGeneric(), Arcane::MetisMeshPartitioner::_writeGraph(), Arcane::VtkLegacyMeshWriter::_writeMeshToFile(), Arcane::centralizePartInfo(), Arcane::FlexLMMng::checkLicense(), Arcane::mesh::TiedInterfaceBuilder::computeInterfaceConnections(), Arcane::CartesianMeshCoarsening::createCoarseCells(), Arcane::Platform::createDirectory(), Arcane::InternalInfosDumper::dumpArcaneDatabase(), Arcane::TimeHistoryMngInternal::dumpCurves(), Arcane::MeshUtils::dumpSynchronizerTopologyJSON(), Arcane::TimeStats::endGatherStats(), Arcane::DumpWEnsight7::endWrite(), Arcane::DumpWUCD::endWrite(), Arcane::TimeLoopMng::execExitEntryPoints(), Arcane::Process::execute(), Arcane::FlexLMMng::featureInfo(), Arcane::platform::getCompilerId(), Arcane::Platform::getEnvironmentVariable(), Arcane::FlexLMMng::getLicense(), Arcane::Platform::getLoadedSharedLibraryFullPath(), Arcane::Otf2LibWrapper::init(), Arcane::CodeService::initCase(), Arcane::PapiPerformanceService::initialize(), Arcane::SimpleTableReaderWriterUtils::isFileExist(), Arcane::Platform::isFileReadable(), Arcane::MessagePassing::namedBarrier(), Arcane::operator<<(), operator<<, Arcane::platform::raiseFloatingException(), Arcane::MatVec::Matrix::read(), Arcane::MatVec::Matrix::readHypre(), Arcane::MatVec::Vector::readHypre(), Arcane::VtkMeshIOService::readMesh(), Arcane::XmfMeshReader::readMeshFromFile(), Arcane::MshMeshReader::readMeshFromMshFile(), Arcane::MshParallelMeshReader::readMeshFromMshFile(), Arcane::TimeHistoryMngInternal::readVariables(), Arcane::FlexLMMng::releaseAllLicenses(), Arcane::FlexLMMng::releaseLicense(), Arcane::ArcaneMain::setErrorCode(), Arcane::impl::BasicWriter::setMetaData(), Arcane::AlephMatrix::solveNow(), split(), Arcane::VersionInfo::VersionInfo(), Arcane::KdiDataWriter::write(), Arcane::GnuplotTimeHistoryCurveWriter2::writeCurve(), Arcane::CheckpointMng::writeDefaultCheckpoint(), Arcane::MshMeshWriter::writeMesh(), Arcane::MeshUtils::writeMeshConnectivity(), Arcane::MeshUtils::writeMeshInfosSorted(), Arcane::LimaMeshWriter::writeMeshToFile(), Arcane::VtuMeshWriter::writeMeshToFile(), Arcane::XmfMeshWriter::writeMeshToFile(), and Arcane::IOMng::writeXmlFile().
| String Arcane::String::lower | ( | ) | const |
Transforms all characters in the string to lowercase.
Definition at line 479 of file String.cc.
Referenced by Arcane::VtkFile::checkString(), Arcane::VtkFile::checkString(), and Arcane::VtkFile::isEqualString().
| bool Arcane::String::null | ( | ) | const |
Returns true if the string is null.
Definition at line 305 of file String.cc.
References m_p.
Referenced by Arcane::ItemTypeMng::_buildTypes(), Arcane::VariableIOReaderMng::_checkHashFunction(), Arcane::ArcaneBasicMeshSubdividerService::_checkMeshUid(), Arcane::TimeLoopMng::_fillModuleFactoryMap(), Arcane::TimeLoopMng::_fillModuleStateMap(), Arcane::dom::DOMImplementation::_load(), Arcane::MetisMeshPartitioner::_partitionMesh(), Arcane::TimeLoopMng::_processEntryPoints(), Arcane::LimaCutInfosReader::_readUniqueIndexFromXml(), Arcane::CaseOptionExtended::_search(), Arcane::CaseOptionMultiExtended::_search(), Arcane::CaseOptionMultiSimpleT< T >::_search(), Arcane::CaseOptionSimpleT< T >::_search(), Arcane::CaseMng::_searchInvalidOptions(), Arcane::ConfigurationReader::addValuesFromXmlNode(), Arcane::VariableMng::addVariable(), Arcane::MeshGeneratorService::allowExtension(), Arcane::StringBuilder::append(), Arcane::XmlNode::attrValue(), Arcane::Application::build(), Arcane::VariableMng::build(), Arcane::centralizePartInfo(), Arcane::VariableMng::checkVariable(), collapseWhiteSpace(), contains(), Arcane::TimeLoopMng::doComputeLoop(), Arcane::mesh::DynamicMesh::endAllocate(), Arcane::Platform::getLoadedSharedLibraryFullPath(), Arcane::MemoryUtils::getMemoryResourceFromName(), Arcane::Materials::MeshMaterialVariableCommonStaticImpl< TrueType >::getReference(), Arcane::PropertyImpl::PropertyKeyValues::getValue(), Arcane::Application::initialize(), Arcane::PapiPerformanceService::initialize(), Arcane::Accelerator::Impl::RuntimeLoader::loadRuntime(), Arcane::CaseOptionName::name(), Arcane::ArcaneBasicCheckpointService::notifyBeginRead(), Arcane::ArcaneBasicCheckpointService::notifyBeginWrite(), Arcane::ArcaneVerifierModule::onExit(), Arcane::dom::LibXml2_Parser::parse(), Arcane::ArcaneMain::parseArgs(), Arcane::CaseOptions::read(), Arcane::CheckpointMng::readCheckpointInfo(), Arcane::LimaMeshReaderService::readMeshFromFile(), Arcane::MeshGeneratorService::readMeshFromFile(), Arcane::TimeLoopReader::readTimeLoops(), Arcane::TimeHistoryMngInternal::readVariables(), Arcane::Accelerator::AcceleratorMemoryAllocatorBase::reallocate(), Arcane::StringVariableReplace::replaceWithCmdLineArgs(), Arcane::TraceMng::setErrorFileName(), Arcane::TraceMng::setLogFileName(), Arcane::CaseFunction::setName(), Arcane::TimeLoopMng::setUsedTimeLoop(), Arcane::Internal::ServiceInfo::tagName(), Arcane::CaseOptionBase::translatedName(), Arcane::CaseOptions::translatedName(), Arcane::Convert::ScalarType< T >::tryParseFromEnvironment(), and Arcane::VtuMeshWriter::writeMeshToFile().
| Arcane::String::operator StringView | ( | ) | const |
Returns a view of the current string.
The encoding used is UTF-8.
Definition at line 381 of file String.cc.
References view().
|
inline |
Returns the concatenation of this string with the string str encoded in UTF-8
Definition at line 376 of file arccore/src/base/arccore/base/String.h.
References operator+, and String().
| String Arcane::String::operator+ | ( | const std::string & | str | ) | const |
| String Arcane::String::operator+ | ( | std::string_view | str | ) | const |
| String Arcane::String::operator+ | ( | unsigned long long | v | ) | const |
|
inline |
References str encoded in UTF-8 in this instance.
Definition at line 142 of file arccore/src/base/arccore/base/String.h.
References _removeReferenceIfNeeded(), m_const_ptr_size, m_p, and String().
| String & Arcane::String::operator= | ( | const std::string & | str | ) |
Copies str encoded in UTF-8 into this instance.
Definition at line 216 of file String.cc.
References operator=(), and String().
Copies str into this instance.
Definition at line 171 of file String.cc.
References _removeReferenceIfNeeded(), m_p, and String().
Referenced by operator=(), operator=(), and operator=().
| String & Arcane::String::operator= | ( | std::string_view | str | ) |
Copies str encoded in UTF-8 into this instance.
Definition at line 207 of file String.cc.
References operator=(), and String().
Copies str into this instance.
Definition at line 184 of file String.cc.
References _removeReferenceIfNeeded(), and String().
| String & Arcane::String::operator= | ( | StringView | str | ) |
Copies str into this instance.
Definition at line 198 of file String.cc.
References operator=(), and String().
Performs whitespace character normalization.
All whitespace characters are replaced by space characters #x20, namely #xD (Carriage Return), #xA (Line Feed), and #x9 (Tabulation). This corresponds to the xs:replace attribute of XMLSchema 1.0
Definition at line 441 of file String.cc.
|
inline |
Splits the string based on the character c.
Definition at line 495 of file arccore/src/base/arccore/base/String.h.
References len(), length(), localstr(), and String().
Referenced by Arcane::SimpleTableWriterHelper::_computeName(), Arcane::ConfigurationReader::addValuesFromXmlNode(), Arcane::PapiPerformanceService::initialize(), and Arcane::SimpleCsvReaderWriter::readTable().
| bool Arcane::String::startsWith | ( | const String & | s | ) | const |
Indicates if the string starts with the characters of s.
Definition at line 1110 of file String.cc.
References bytes(), Arcane::SpanImpl< T, SizeType, Extent >::data(), Arcane::SpanImpl< T, SizeType, Extent >::size(), and String().
Referenced by Arcane::SimpleTableWriterHelper::_computeName(), Arcane::ParameterOptionElementsCollection::addParameter(), and Arcane::BackwardCppStackTraceService::stackTrace().
Substring starting at position pos.
Definition at line 1125 of file String.cc.
References length(), String(), and substring().
Referenced by Arcane::VtkMeshIOService::_readData(), Arcane::ParameterList::addParameterLine(), Arcane::ParameterListWithCaseOption::addParameterLine(), and substring().
| std::string_view Arcane::String::toStdStringView | ( | ) | const |
Returns an STL view of the current string.
The encoding used is UTF-8.
Definition at line 349 of file String.cc.
References ARCCORE_FATAL, m_const_ptr_size, and m_p.
Referenced by Arcane::LegacyMeshBuilder::_readMesh(), contains(), Arcane::Application::getCodeService(), len(), length(), Arcane::MeshReaderMng::readMesh(), and String().
| String Arcane::String::upper | ( | ) | const |
Transforms all characters in the string to uppercase.
Definition at line 467 of file String.cc.
Referenced by Arcane::MetisMeshPartitioner::_partitionMesh().
| ConstArrayView< UChar > Arcane::String::utf16 | ( | ) | const |
Returns the conversion of the instance into UTF-16 encoding.
The returned array always contains a terminal zero if the string is not null-terminated. Therefore, the size of any non-null string is the array size minus 1.
| ByteConstArrayView Arcane::String::utf8 | ( | ) | const |
Returns the conversion of the instance into UTF-8 encoding.
The returned array always contains a terminal zero if the string is not null-terminated. Therefore, the size of any non-null string is the array size minus 1.
Definition at line 276 of file String.cc.
References Arcane::arccoreCheckArraySize(), m_const_ptr_size, and m_p.
Referenced by Arcane::VtkMeshIOService::_readData(), Arcane::FlexLMMng::featureInfo(), Arcane::GlibDynamicLibrary::getSymbolAddress(), Arcane::IOMng::parseXmlString(), and Arcane::impl::BasicWriter::setMetaData().
| StringView Arcane::String::view | ( | ) | const |
Returns a view of the current string.
The encoding used is UTF-8.
Definition at line 368 of file String.cc.
References m_p.
Referenced by Arcane::ParameterOptionElementsCollection::addParameter(), Arcane::builtInGetValue(), Arcane::ParameterCaseOption::count(), Arcane::ParameterCaseOption::count(), Arcane::ParameterCaseOption::exist(), Arcane::ParameterCaseOption::existAnyIndex(), Arcane::ParameterCaseOption::existAnyIndex(), Arcane::ParameterCaseOption::getParameterOrNull(), Arcane::ParameterCaseOption::getParameterOrNull(), Arcane::ParameterCaseOption::getParameterOrNull(), Arcane::ParameterCaseOption::indexesInParam(), Arcane::ParameterCaseOption::indexesInParam(), and operator StringView().
| void Arcane::String::writeBytes | ( | std::ostream & | o | ) | const |
Writes the string in UTF-8 format to the stream o.
Definition at line 1246 of file String.cc.
References bytes(), Arcane::SpanImpl< T, SizeType, Extent >::data(), and Arcane::SpanImpl< T, SizeType, Extent >::size().
Referenced by Arcane::InternalInfosDumper::dumpArcaneDatabase(), operator<<, and Arcane::impl::BasicWriter::setMetaData().
|
friend |
Compares two unicode strings.
| true | if they are different, |
| false | if they are equal. |
Definition at line 345 of file arccore/src/base/arccore/base/String.h.
References operator==, and String().
|
friend |
Compares two unicode strings.
| true | if they are different, |
| false | if they are equal. |
Definition at line 362 of file arccore/src/base/arccore/base/String.h.
References operator==, and String().
Compares two unicode strings.
| true | if they are different, |
| false | if they are equal. \relate String |
Definition at line 323 of file arccore/src/base/arccore/base/String.h.
References operator==, and String().
|
friend |
String output operator.
Definition at line 1231 of file String.cc.
References localstr(), operator<<, String(), and writeBytes().
Referenced by operator<<.
|
friend |
Compares two unicode strings.
| true | if they are equal, |
| false | otherwise. |
Definition at line 1199 of file String.cc.
References operator==, and String().
|
friend |
Compares two unicode strings.
| true | if they are equal, |
| false | otherwise. |
Definition at line 1193 of file String.cc.
References operator==, and String().
Compares two unicode strings.
| true | if they are equal, |
| false | otherwise. \relate String |
Definition at line 1164 of file String.cc.
References Arcane::CStringUtils::isEqual(), m_p, operator==, and String().
Referenced by operator!=, operator!=, operator!=, operator==, operator==, and operator==.
|
friend |
|
friend |
Definition at line 74 of file arccore/src/base/arccore/base/String.h.
|
friend |
Definition at line 75 of file arccore/src/base/arccore/base/String.h.
|
mutableprivate |
Definition at line 534 of file arccore/src/base/arccore/base/String.h.
|
mutableprivate |
String length if constant (-1 otherwise).
Definition at line 535 of file arccore/src/base/arccore/base/String.h.
Referenced by Arcane::StringBuilder::append(), bytes(), operator=(), String(), String(), String(), String(), String(), String(), String(), String(), String(), String(), String(), String(), toStdStringView(), and utf8().
|
mutableprivate |
Class implementation.
Definition at line 533 of file arccore/src/base/arccore/base/String.h.
Referenced by _removeImplReference(), _removeReferenceIfNeeded(), Arcane::StringBuilder::append(), bytes(), clone(), collapseWhiteSpace(), empty(), internalDump(), localstr(), lower(), null(), operator=(), operator=(), Arcane::StringBuilder::operator=(), operator==, replaceWhiteSpace(), String(), String(), String(), String(), String(), String(), String(), String(), String(), String(), String(), substring(), toStdStringView(), upper(), utf8(), and view().