88// -----------------------------------------------------------------------------
99
1010#include " config.h"
11- #include " Properties .h"
11+ #include " Defaults .h"
1212#include " Amiga.h"
1313#include " StringUtils.h"
1414#include " AgnusTypes.h"
2727#include " RemoteManagerTypes.h"
2828#include " RemoteServerTypes.h"
2929
30- Properties::Properties ()
30+ Defaults::Defaults ()
3131{
3232 setFallback (OPT_AGNUS_REVISION, AGNUS_ECS_1MB);
3333 setFallback (OPT_SLOW_RAM_MIRROR, true );
@@ -140,7 +140,7 @@ Properties::Properties()
140140}
141141
142142void
143- Properties ::_dump (Category category, std::ostream& os) const
143+ Defaults ::_dump (Category category, std::ostream& os) const
144144{
145145 for (const auto &it: fallbacks) {
146146
@@ -160,7 +160,7 @@ Properties::_dump(Category category, std::ostream& os) const
160160}
161161
162162void
163- Properties ::load (const fs::path &path)
163+ Defaults ::load (const fs::path &path)
164164{
165165 auto fs = std::ifstream (path, std::ifstream::binary);
166166
@@ -173,7 +173,7 @@ Properties::load(const fs::path &path)
173173}
174174
175175void
176- Properties ::load (std::ifstream &stream)
176+ Defaults ::load (std::ifstream &stream)
177177{
178178 std::stringstream ss;
179179 ss << stream.rdbuf ();
@@ -182,7 +182,7 @@ Properties::load(std::ifstream &stream)
182182}
183183
184184void
185- Properties ::load (std::stringstream &stream)
185+ Defaults ::load (std::stringstream &stream)
186186{
187187 isize line = 0 ;
188188 isize accepted = 0 ;
@@ -251,7 +251,7 @@ Properties::load(std::stringstream &stream)
251251}
252252
253253void
254- Properties ::save (const fs::path &path)
254+ Defaults ::save (const fs::path &path)
255255{
256256 auto fs = std::ofstream (path, std::ofstream::binary);
257257
@@ -263,7 +263,7 @@ Properties::save(const fs::path &path)
263263}
264264
265265void
266- Properties ::save (std::ofstream &stream)
266+ Defaults ::save (std::ofstream &stream)
267267{
268268 std::stringstream ss;
269269 save (ss);
@@ -272,7 +272,7 @@ Properties::save(std::ofstream &stream)
272272}
273273
274274void
275- Properties ::save (std::stringstream &stream)
275+ Defaults ::save (std::stringstream &stream)
276276{
277277 { SYNCHRONIZED
278278
@@ -320,7 +320,7 @@ Properties::save(std::stringstream &stream)
320320}
321321
322322string
323- Properties ::getString (const string &key)
323+ Defaults ::getString (const string &key)
324324{
325325 if (values.contains (key)) return values[key];
326326 if (fallbacks.contains (key)) return fallbacks[key];
@@ -331,7 +331,7 @@ Properties::getString(const string &key)
331331}
332332
333333i64
334- Properties ::getInt (const string &key)
334+ Defaults ::getInt (const string &key)
335335{
336336 auto value = getString (key);
337337 i64 result = 0 ;
@@ -350,19 +350,19 @@ Properties::getInt(const string &key)
350350}
351351
352352i64
353- Properties ::get (Option option)
353+ Defaults ::get (Option option)
354354{
355355 return getInt (string (OptionEnum::key (option)));
356356}
357357
358358i64
359- Properties ::get (Option option, isize nr)
359+ Defaults ::get (Option option, isize nr)
360360{
361361 return getInt (string (OptionEnum::key (option)) + std::to_string (nr));
362362}
363363
364364string
365- Properties ::getFallback (const string &key)
365+ Defaults ::getFallback (const string &key)
366366{
367367 if (!fallbacks.contains (key)) {
368368
@@ -375,7 +375,7 @@ Properties::getFallback(const string &key)
375375}
376376
377377void
378- Properties ::setString (const string &key, const string &value)
378+ Defaults ::setString (const string &key, const string &value)
379379{
380380 { SYNCHRONIZED
381381
@@ -393,7 +393,7 @@ Properties::setString(const string &key, const string &value)
393393}
394394
395395void
396- Properties ::set (Option option, i64 value)
396+ Defaults ::set (Option option, i64 value)
397397{
398398 auto key = string (OptionEnum::key (option));
399399 auto val = std::to_string (value);
@@ -402,7 +402,7 @@ Properties::set(Option option, i64 value)
402402}
403403
404404void
405- Properties ::set (Option option, isize nr, i64 value)
405+ Defaults ::set (Option option, isize nr, i64 value)
406406{
407407 auto key = string (OptionEnum::key (option)) + std::to_string (nr);
408408 auto val = std::to_string (value);
@@ -411,13 +411,13 @@ Properties::set(Option option, isize nr, i64 value)
411411}
412412
413413void
414- Properties ::set (Option option, std::vector <isize> nrs, i64 value)
414+ Defaults ::set (Option option, std::vector <isize> nrs, i64 value)
415415{
416416 for (auto &nr : nrs) set (option, nr, value);
417417}
418418
419419void
420- Properties ::setFallback (const string &key, const string &value)
420+ Defaults ::setFallback (const string &key, const string &value)
421421{
422422 { SYNCHRONIZED
423423
@@ -428,49 +428,49 @@ Properties::setFallback(const string &key, const string &value)
428428}
429429
430430void
431- Properties ::setFallback (Option option, const string &value)
431+ Defaults ::setFallback (Option option, const string &value)
432432{
433433 setFallback (string (OptionEnum::key (option)), value);
434434}
435435
436436void
437- Properties ::setFallback (Option option, i64 value)
437+ Defaults ::setFallback (Option option, i64 value)
438438{
439439 setFallback (option, std::to_string (value));
440440}
441441
442442void
443- Properties ::setFallback (Option option, isize nr, const string &value)
443+ Defaults ::setFallback (Option option, isize nr, const string &value)
444444{
445445 setFallback (string (OptionEnum::key (option)) + std::to_string (nr), value);
446446}
447447
448448void
449- Properties ::setFallback (Option option, isize nr, i64 value)
449+ Defaults ::setFallback (Option option, isize nr, i64 value)
450450{
451451 setFallback (option, nr, std::to_string (value));
452452}
453453
454454void
455- Properties ::setFallback (Option option, std::vector <isize> nrs, const string &value)
455+ Defaults ::setFallback (Option option, std::vector <isize> nrs, const string &value)
456456{
457457 for (auto &nr : nrs) setFallback (option, nr, value);
458458}
459459
460460void
461- Properties ::setFallback (Option option, std::vector <isize> nrs, i64 value)
461+ Defaults ::setFallback (Option option, std::vector <isize> nrs, i64 value)
462462{
463463 setFallback (option, nrs, std::to_string (value));
464464}
465465
466466void
467- Properties ::remove ()
467+ Defaults ::remove ()
468468{
469469 SYNCHRONIZED values.clear ();
470470}
471471
472472void
473- Properties ::remove (const string &key)
473+ Defaults ::remove (const string &key)
474474{
475475 { SYNCHRONIZED
476476
@@ -487,19 +487,19 @@ Properties::remove(const string &key)
487487}
488488
489489void
490- Properties ::remove (Option option)
490+ Defaults ::remove (Option option)
491491{
492492 remove (string (OptionEnum::key (option)));
493493 }
494494
495495void
496- Properties ::remove (Option option, isize nr)
496+ Defaults ::remove (Option option, isize nr)
497497{
498498 remove (string (OptionEnum::key (option)) + std::to_string (nr));
499499}
500500
501501void
502- Properties ::remove (Option option, std::vector <isize> nrs)
502+ Defaults ::remove (Option option, std::vector <isize> nrs)
503503{
504504 for (auto &nr : nrs) remove (option, nr);
505505}
0 commit comments