@@ -33,7 +33,7 @@ class KeyValueStringTokenizer
33
33
public:
34
34
KeyValueStringTokenizer (
35
35
nostd::string_view str,
36
- const KeyValueStringTokenizerOptions &opts = KeyValueStringTokenizerOptions())
36
+ const KeyValueStringTokenizerOptions &opts = KeyValueStringTokenizerOptions()) noexcept
37
37
: str_(str), opts_(opts), index_(0 )
38
38
{}
39
39
@@ -48,7 +48,7 @@ class KeyValueStringTokenizer
48
48
// @param key : key in kv pair
49
49
// @param key : value in kv pair
50
50
// @returns true if next kv pair was found, false otherwise.
51
- bool next (bool &valid_kv, nostd::string_view &key, nostd::string_view &value)
51
+ bool next (bool &valid_kv, nostd::string_view &key, nostd::string_view &value) noexcept
52
52
{
53
53
valid_kv = true ;
54
54
while (index_ < str_.size ())
@@ -170,13 +170,13 @@ class KeyValueProperties
170
170
}
171
171
172
172
// Gets the key associated with this entry.
173
- nostd::string_view GetKey () const { return key_.get (); }
173
+ nostd::string_view GetKey () const noexcept { return key_.get (); }
174
174
175
175
// Gets the value associated with this entry.
176
- nostd::string_view GetValue () const { return value_.get (); }
176
+ nostd::string_view GetValue () const noexcept { return value_.get (); }
177
177
178
178
// Sets the value for this entry. This overrides the previous value.
179
- void SetValue (nostd::string_view value) { value_ = CopyStringToPointer (value); }
179
+ void SetValue (nostd::string_view value) noexcept { value_ = CopyStringToPointer (value); }
180
180
181
181
private:
182
182
// Store key and value as raw char pointers to avoid using std::string.
@@ -206,15 +206,15 @@ class KeyValueProperties
206
206
public:
207
207
// Create Key-value list of given size
208
208
// @param size : Size of list.
209
- KeyValueProperties (size_t size)
209
+ KeyValueProperties (size_t size) noexcept
210
210
: num_entries_(0 ), max_num_entries_(size), entries_(new Entry[size])
211
211
{}
212
212
213
213
// Create Empty Key-Value list
214
- KeyValueProperties () : num_entries_(0 ), max_num_entries_(0 ), entries_(nullptr ) {}
214
+ KeyValueProperties () noexcept : num_entries_(0 ), max_num_entries_(0 ), entries_(nullptr ) {}
215
215
216
216
template <class T , class = typename std::enable_if<detail::is_key_value_iterable<T>::value>::type>
217
- KeyValueProperties (const T &keys_and_values)
217
+ KeyValueProperties (const T &keys_and_values) noexcept
218
218
: num_entries_(0 ),
219
219
max_num_entries_ (keys_and_values.size()),
220
220
entries_(new Entry[max_num_entries_])
@@ -227,7 +227,7 @@ class KeyValueProperties
227
227
}
228
228
229
229
// Adds new kv pair into kv properties
230
- void AddEntry (nostd::string_view key, nostd::string_view value)
230
+ void AddEntry (nostd::string_view key, nostd::string_view value) noexcept
231
231
{
232
232
if (num_entries_ < max_num_entries_)
233
233
{
@@ -238,7 +238,7 @@ class KeyValueProperties
238
238
239
239
// Returns all kv pair entries
240
240
bool GetAllEntries (
241
- nostd::function_ref<bool (nostd::string_view, nostd::string_view)> callback) const
241
+ nostd::function_ref<bool (nostd::string_view, nostd::string_view)> callback) const noexcept
242
242
{
243
243
for (size_t i = 0 ; i < num_entries_; i++)
244
244
{
@@ -252,7 +252,7 @@ class KeyValueProperties
252
252
}
253
253
254
254
// Return value for key if exists, return false otherwise
255
- bool GetValue (nostd::string_view key, std::string &value) const
255
+ bool GetValue (nostd::string_view key, std::string &value) const noexcept
256
256
{
257
257
for (size_t i = 0 ; i < num_entries_; i++)
258
258
{
0 commit comments