Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.Requires a signed-in GitHub account. This works well for small changes.If you'd like to make larger changes you may want to consider usinga local clone.

core.stdcpp.string

D header file for interaction with C++ std::string.
License:
Distributed under theBoost Software License 1.0. (See accompanying file LICENSE)
Authors:
Guillaume Chatelet Manu Evans

Sourcecore/stdcpp/string.d

enum DefaultConstructDefault;
Constructor argument for default construction
structchar_traits(CharT);
Character traits classes specify character properties and provide specific semantics for certain operations on characters and sequences of characters.
structbasic_string(T, Traits = char_traits!T, Alloc = allocator!T);
D language counterpart to C++ std::basic_string.
C++ reference:
enum size_typenpos;
aliassize_type = size_t;
aliasdifference_type = ptrdiff_t;
aliasvalue_type = T;
aliastraits_type = Traits;
aliasallocator_type = Alloc;
aliaspointer = value_type*;
aliasconst_pointer = const(value_type)*;
aliastoString = as_array;
this();
MSVC allocates on default initialisation in debug, which can't be modelled by Dstruct
aliaslength = size;
aliasopDollar = length;
nothrow @trusted boolempty() const;
pure nothrow @nogc @safe size_t[2]opSlice(size_t dim : 0)(size_tstart, size_tend) const;
pure nothrow @nogc ref @safe inout(T)opIndex(size_tindex) inout;
pure nothrow @nogc @safe inout(T)[]opIndex(size_t[2]slice) inout;
pure nothrow @nogc @safe inout(T)[]opIndex() inout;
pure nothrow @safe boolopEquals(ref scope const basic_strings) const;

pure nothrow @safe boolopEquals(scope const T[]s) const;
Twobasic_strings are equal if they represent the same sequence of code units.
pure nothrow @safe intopCmp(ref scope const basic_stringrhs) const;

pure nothrow @safe intopCmp(scope const T[]rhs) const;
Performs lexicographical comparison.
pure nothrow @nogc @safe size_ttoHash() const;
Hash to allowbasic_strings to be used as keys for built-in associative arrays.The result will generally not be the same as C++std::hash<std::basic_string<T>>.
voidclear();
@trusted voidresize(size_typen, Tc = T(0));
nothrow ref @safe inout(T)front() inout;
nothrow ref @safe inout(T)back() inout;
nothrow @safe const(T)*c_str() const;
ref basic_stringopAssign()(auto ref basic_stringstr);
ref basic_stringopAssign(const(T)[]str);
ref basic_stringopAssign(Tc);
ref basic_stringopIndexAssign(Tc, size_tindex);
ref basic_stringopIndexAssign(Tc, size_t[2]slice);
ref basic_stringopIndexAssign(const(T)[]str, size_t[2]slice);
ref basic_stringopIndexAssign(Tc);
ref basic_stringopIndexAssign(const(T)[]str);
ref basic_stringopIndexOpAssign(string op)(Tc, size_tindex);
ref basic_stringopIndexOpAssign(string op)(Tc, size_t[2]slice);
ref basic_stringopIndexOpAssign(string op)(const(T)[]str, size_t[2]slice);
ref basic_stringopIndexOpAssign(string op)(Tc);
ref basic_stringopIndexOpAssign(string op)(const(T)[]str);
ref basic_stringappend(Tc);
ref basic_stringopOpAssign(string op : "~")(const(T)[]str);
ref basic_stringopOpAssign(string op : "~")(Tc);
ref basic_stringinsert(size_typepos, ref const(basic_string)str);
ref @trusted basic_stringinsert(size_typepos, ref const(basic_string)str, size_typesubpos, size_typesublen);
ref basic_stringinsert(S : size_type)(Spos, const(T)*s);
ref basic_stringinsert(size_typepos, const(T)[]s);
ref basic_stringerase(size_typepos = 0);
ref basic_stringerase(size_typepos, size_typelen);
ref basic_stringreplace()(size_typepos, size_typelen, auto ref basic_stringstr);
ref basic_stringreplace()(size_typepos, size_typelen, auto ref basic_stringstr, size_typesubpos, size_typesublen = npos);
ref basic_stringreplace(size_typepos, size_typelen, const(value_type)[]s);
ref basic_stringreplace(S : size_type)(Spos, size_typelen, const(value_type)*s);
@trusted voidpush_back(Tc);
voidpop_back();
this(DefaultConstruct);
this(const(T)[]str);
this(const(T)[]str, ref const(allocator_type)al);
ref inout(Alloc)get_allocator() inout;
nothrow @safe size_typemax_size() const;
nothrow @safe size_typesize() const;
nothrow @safe size_typecapacity() const;
@safe inout(T)*data() inout;
nothrow @trusted inout(T)[]as_array() inout scope return;
nothrow ref @trusted inout(T)at(size_typei) inout;
ref basic_stringassign(const(T)[]str);
ref basic_stringassign(ref const basic_stringstr);
ref basic_stringappend(const(T)[]str);
ref basic_stringappend(size_typen, Tc);
voidreserve(size_type_Newcap = 0);
voidshrink_to_fit();
ref basic_stringinsert(size_typepos, const(T)*s, size_typen);
ref basic_stringinsert(size_typepos, size_typen, Tc);
ref basic_stringreplace(size_typepos, size_typelen, const(T)*s, size_typeslen);
ref basic_stringreplace(size_type_Off, size_type_N0, size_type_Count, T_Ch);
voidswap(ref basic_string_Right);
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Fri Feb 20 17:57:09 2026

[8]ページ先頭

©2009-2026 Movatter.jp