@@ -33,7 +33,7 @@ class KeyValueStringTokenizer
3333public:
3434 KeyValueStringTokenizer (
3535 nostd::string_view str,
36- const KeyValueStringTokenizerOptions &opts = KeyValueStringTokenizerOptions())
36+ const KeyValueStringTokenizerOptions &opts = KeyValueStringTokenizerOptions()) noexcept
3737 : str_(str), opts_(opts), index_(0 )
3838 {}
3939
@@ -48,7 +48,7 @@ class KeyValueStringTokenizer
4848 // @param key : key in kv pair
4949 // @param key : value in kv pair
5050 // @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
5252 {
5353 valid_kv = true ;
5454 while (index_ < str_.size ())
@@ -170,13 +170,13 @@ class KeyValueProperties
170170 }
171171
172172 // 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 (); }
174174
175175 // 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 (); }
177177
178178 // 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); }
180180
181181 private:
182182 // Store key and value as raw char pointers to avoid using std::string.
@@ -206,15 +206,15 @@ class KeyValueProperties
206206public:
207207 // Create Key-value list of given size
208208 // @param size : Size of list.
209- KeyValueProperties (size_t size)
209+ KeyValueProperties (size_t size) noexcept
210210 : num_entries_(0 ), max_num_entries_(size), entries_(new Entry[size])
211211 {}
212212
213213 // 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 ) {}
215215
216216 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
218218 : num_entries_(0 ),
219219 max_num_entries_ (keys_and_values.size()),
220220 entries_(new Entry[max_num_entries_])
@@ -227,7 +227,7 @@ class KeyValueProperties
227227 }
228228
229229 // 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
231231 {
232232 if (num_entries_ < max_num_entries_)
233233 {
@@ -238,7 +238,7 @@ class KeyValueProperties
238238
239239 // Returns all kv pair entries
240240 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
242242 {
243243 for (size_t i = 0 ; i < num_entries_; i++)
244244 {
@@ -252,7 +252,7 @@ class KeyValueProperties
252252 }
253253
254254 // 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
256256 {
257257 for (size_t i = 0 ; i < num_entries_; i++)
258258 {
0 commit comments