• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1.. _module-pw_string-api:
2
3=============
4API Reference
5=============
6
7--------
8Overview
9--------
10This module provides two types of strings, and utility functions for working
11with strings.
12
13**pw::StringBuilder**
14
15.. doxygenfile:: pw_string/string_builder.h
16   :sections: briefdescription
17
18**pw::InlineString**
19
20.. doxygenfile:: pw_string/string.h
21   :sections: briefdescription
22
23**String utility functions**
24
25.. doxygenfile:: pw_string/util.h
26   :sections: briefdescription
27
28-----------------
29pw::StringBuilder
30-----------------
31.. doxygenfile:: pw_string/string_builder.h
32   :sections: briefdescription
33.. doxygenclass:: pw::StringBuilder
34   :members:
35
36----------------
37pw::InlineString
38----------------
39.. doxygenfile:: pw_string/string.h
40   :sections: detaileddescription
41
42.. doxygenclass:: pw::InlineBasicString
43   :members:
44
45.. doxygentypedef:: pw::InlineString
46
47------------------------
48String utility functions
49------------------------
50
51pw::string::Assign()
52--------------------
53.. doxygenfunction:: pw::string::Assign(InlineString<> &string, const std::string_view &view)
54
55pw::string::Append()
56--------------------
57.. doxygenfunction:: pw::string::Append(InlineString<>& string, const std::string_view& view)
58
59pw::string::ClampedCString()
60----------------------------
61.. doxygenfunction:: pw::string::ClampedCString(const char* str, size_t max_len)
62.. doxygenfunction:: pw::string::ClampedCString(span<const char> str)
63
64pw::string::Copy()
65------------------
66.. doxygenfunction:: pw::string::Copy(const char* source, char* dest, size_t num)
67.. doxygenfunction:: pw::string::Copy(const char* source, Span&& dest)
68.. doxygenfunction:: pw::string::Copy(const std::string_view& source, Span&& dest)
69
70It also has variants that provide a destination of ``pw::Vector<char>``
71(see :ref:`module-pw_containers` for details) that do not store the null
72terminator in the vector.
73
74.. cpp:function:: StatusWithSize Copy(const std::string_view& source, pw::Vector<char>& dest)
75.. cpp:function:: StatusWithSize Copy(const char* source, pw::Vector<char>& dest)
76
77pw::string::Format()
78--------------------
79.. doxygenfile:: pw_string/format.h
80   :sections: briefdescription
81.. doxygenfunction:: pw::string::Format
82.. doxygenfunction:: pw::string::FormatVaList
83
84pw::string::NullTerminatedLength()
85----------------------------------
86.. doxygenfunction:: pw::string::NullTerminatedLength(const char* str, size_t max_len)
87.. doxygenfunction:: pw::string::NullTerminatedLength(span<const char> str)
88
89pw::string::PrintableCopy()
90---------------------------
91.. doxygenfunction:: pw::string::PrintableCopy(const std::string_view& source, span<char> dest)
92