@@ -38,22 +38,22 @@ static bool formatSprintf(StringFormatOutput& data, const char (&formatSpecifier
38
38
}
39
39
#if SC_COMPILER_MSVC || SC_COMPILER_CLANG_CL
40
40
#if SC_PLATFORM_64_BIT == 0
41
- bool StringFormatterFor<ssize_t >::format(StringFormatOutput& data, const StringView specifier, const long value)
41
+ bool StringFormatterFor<ssize_t >::format(StringFormatOutput& data, const StringSpan specifier, const long value)
42
42
{
43
43
constexpr char formatSpecifier[] = " d" ;
44
44
return formatSprintf (data, formatSpecifier, specifier, value);
45
45
}
46
46
#endif
47
47
#else
48
48
#if !SC_PLATFORM_LINUX
49
- bool StringFormatterFor<SC::size_t >::format(StringFormatOutput& data, const StringView specifier,
49
+ bool StringFormatterFor<SC::size_t >::format(StringFormatOutput& data, const StringSpan specifier,
50
50
const SC::size_t value)
51
51
{
52
52
constexpr char formatSpecifier[] = " zu" ;
53
53
return formatSprintf (data, formatSpecifier, specifier, value);
54
54
}
55
55
56
- bool StringFormatterFor<SC::ssize_t >::format(StringFormatOutput& data, const StringView specifier,
56
+ bool StringFormatterFor<SC::ssize_t >::format(StringFormatOutput& data, const StringSpan specifier,
57
57
const SC::ssize_t value)
58
58
{
59
59
constexpr char formatSpecifier[] = " zd" ;
@@ -62,122 +62,122 @@ bool StringFormatterFor<SC::ssize_t>::format(StringFormatOutput& data, const Str
62
62
#endif
63
63
#endif
64
64
65
- bool StringFormatterFor<SC::int64_t >::format(StringFormatOutput& data, const StringView specifier,
65
+ bool StringFormatterFor<SC::int64_t >::format(StringFormatOutput& data, const StringSpan specifier,
66
66
const SC::int64_t value)
67
67
{
68
68
constexpr char formatSpecifier[] = PRIi64;
69
69
return formatSprintf (data, formatSpecifier, specifier, value);
70
70
}
71
71
72
- bool StringFormatterFor<SC::uint64_t >::format(StringFormatOutput& data, const StringView specifier,
72
+ bool StringFormatterFor<SC::uint64_t >::format(StringFormatOutput& data, const StringSpan specifier,
73
73
const SC::uint64_t value)
74
74
{
75
75
constexpr char formatSpecifier[] = PRIu64;
76
76
return formatSprintf (data, formatSpecifier, specifier, value);
77
77
}
78
78
79
- bool StringFormatterFor<SC::int32_t >::format(StringFormatOutput& data, const StringView specifier,
79
+ bool StringFormatterFor<SC::int32_t >::format(StringFormatOutput& data, const StringSpan specifier,
80
80
const SC::int32_t value)
81
81
{
82
82
constexpr char formatSpecifier[] = " d" ;
83
83
return formatSprintf (data, formatSpecifier, specifier, value);
84
84
}
85
85
86
- bool StringFormatterFor<SC::uint32_t >::format(StringFormatOutput& data, const StringView specifier,
86
+ bool StringFormatterFor<SC::uint32_t >::format(StringFormatOutput& data, const StringSpan specifier,
87
87
const SC::uint32_t value)
88
88
{
89
89
constexpr char formatSpecifier[] = " d" ;
90
90
return formatSprintf (data, formatSpecifier, specifier, value);
91
91
}
92
92
93
- bool StringFormatterFor<SC::int16_t >::format(StringFormatOutput& data, const StringView specifier,
93
+ bool StringFormatterFor<SC::int16_t >::format(StringFormatOutput& data, const StringSpan specifier,
94
94
const SC::int16_t value)
95
95
{
96
96
return StringFormatterFor<SC::int32_t >::format (data, specifier, value);
97
97
}
98
98
99
- bool StringFormatterFor<SC::uint16_t >::format(StringFormatOutput& data, const StringView specifier,
99
+ bool StringFormatterFor<SC::uint16_t >::format(StringFormatOutput& data, const StringSpan specifier,
100
100
const SC::uint16_t value)
101
101
{
102
102
return StringFormatterFor<SC::uint32_t >::format (data, specifier, value);
103
103
}
104
- bool StringFormatterFor<SC::int8_t >::format(StringFormatOutput& data, const StringView specifier,
104
+ bool StringFormatterFor<SC::int8_t >::format(StringFormatOutput& data, const StringSpan specifier,
105
105
const SC::int8_t value)
106
106
{
107
107
return StringFormatterFor<SC::int32_t >::format (data, specifier, value);
108
108
}
109
109
110
- bool StringFormatterFor<SC::uint8_t >::format(StringFormatOutput& data, const StringView specifier,
110
+ bool StringFormatterFor<SC::uint8_t >::format(StringFormatOutput& data, const StringSpan specifier,
111
111
const SC::uint8_t value)
112
112
{
113
113
return StringFormatterFor<SC::uint32_t >::format (data, specifier, value);
114
114
}
115
115
116
- bool StringFormatterFor<bool >::format(StringFormatOutput& data, const StringView specifier, const bool value)
116
+ bool StringFormatterFor<bool >::format(StringFormatOutput& data, const StringSpan specifier, const bool value)
117
117
{
118
118
SC_COMPILER_UNUSED (specifier);
119
119
return data.append (value ? " true" _a8 : " false" _a8);
120
120
}
121
121
122
- bool StringFormatterFor<float >::format(StringFormatOutput& data, StringView specifier, const float value)
122
+ bool StringFormatterFor<float >::format(StringFormatOutput& data, const StringSpan specifier, const float value)
123
123
{
124
124
constexpr char formatSpecifier[] = " f" ;
125
125
return formatSprintf (data, formatSpecifier, specifier, value);
126
126
}
127
127
128
- bool StringFormatterFor<double >::format(StringFormatOutput& data, const StringView specifier, const double value)
128
+ bool StringFormatterFor<double >::format(StringFormatOutput& data, const StringSpan specifier, const double value)
129
129
{
130
130
constexpr char formatSpecifier[] = " f" ;
131
131
return formatSprintf (data, formatSpecifier, specifier, value);
132
132
}
133
133
134
- bool StringFormatterFor<char >::format(StringFormatOutput& data, const StringView specifier, const char value)
134
+ bool StringFormatterFor<char >::format(StringFormatOutput& data, const StringSpan specifier, const char value)
135
135
{
136
136
SC_COMPILER_UNUSED (specifier);
137
137
return data.append (StringView ({&value, sizeof (value)}, false , StringEncoding::Ascii));
138
138
}
139
139
140
- bool StringFormatterFor<const char *>::format(StringFormatOutput& data, const StringView specifier, const char * value)
140
+ bool StringFormatterFor<const char *>::format(StringFormatOutput& data, const StringSpan specifier, const char * value)
141
141
{
142
142
SC_COMPILER_UNUSED (specifier);
143
143
return data.append (StringView::fromNullTerminated (value, StringEncoding::Ascii));
144
144
}
145
145
146
- bool StringFormatterFor<const void *>::format(StringFormatOutput& data, const StringView specifier, const void * value)
146
+ bool StringFormatterFor<const void *>::format(StringFormatOutput& data, const StringSpan specifier, const void * value)
147
147
{
148
148
constexpr char formatSpecifier[] = " p" ;
149
149
return formatSprintf (data, formatSpecifier, specifier, value);
150
150
}
151
151
152
152
#if SC_PLATFORM_WINDOWS
153
- bool StringFormatterFor<wchar_t >::format(StringFormatOutput& data, const StringView specifier, const wchar_t value)
153
+ bool StringFormatterFor<wchar_t >::format(StringFormatOutput& data, const StringSpan specifier, const wchar_t value)
154
154
{
155
155
SC_COMPILER_UNUSED (specifier);
156
156
return data.append (StringView ({&value, 1 }, false ));
157
157
}
158
158
159
- bool StringFormatterFor<const wchar_t *>::format(StringFormatOutput& data, const StringView specifier,
159
+ bool StringFormatterFor<const wchar_t *>::format(StringFormatOutput& data, const StringSpan specifier,
160
160
const wchar_t * value)
161
161
{
162
162
SC_COMPILER_UNUSED (specifier);
163
163
return data.append (StringView ({value, wcslen (value)}, true ));
164
164
}
165
165
#endif
166
166
167
- bool StringFormatterFor<StringView>::format(StringFormatOutput& data, const StringView specifier,
167
+ bool StringFormatterFor<StringView>::format(StringFormatOutput& data, const StringSpan specifier,
168
168
const StringView value)
169
169
{
170
170
SC_COMPILER_UNUSED (specifier);
171
171
return data.append (value);
172
172
}
173
173
174
- bool StringFormatterFor<StringSpan>::format(StringFormatOutput& data, const StringView specifier, StringSpan value)
174
+ bool StringFormatterFor<StringSpan>::format(StringFormatOutput& data, const StringSpan specifier, StringSpan value)
175
175
{
176
176
SC_COMPILER_UNUSED (specifier);
177
177
return data.append (value);
178
178
}
179
179
180
- bool StringFormatterFor<StringPath>::format(StringFormatOutput& data, const StringView specifier, const StringPath& str)
180
+ bool StringFormatterFor<StringPath>::format(StringFormatOutput& data, const StringSpan specifier, const StringPath& str)
181
181
{
182
182
return StringFormatterFor<StringSpan>::format (data, specifier, str.view ());
183
183
}
0 commit comments