Commit Graph

21 Commits

Author SHA1 Message Date
Niel Lebeck 1d79991ec4 Split `SettingsHandler` into separate reader and writer classes 2024-10-21 20:20:15 -07:00
Niel Lebeck 36cdb4a544 Eliminate SettingsHandler's `SetBytes` and `Reset` methods
Also make the `Decrypt` method private.

As far as I can tell, the only motivation for exposing the `SetBytes`
and `Reset` methods is to allow `CBoot::SetupWiiMemory` to use the same
`SettingsHandler` instance to read settings data and then write it back.
It seems cleaner to just use two separate instances, and require a given
`SettingsHandler` instance to be used for either writing data to a
buffer or reading data from a buffer, but not both.

A natural next step is to split the `SettingsHandler` class into two
classes, one for writing data and one for reading data. I've deferred
that change for a future PR.
2024-04-23 17:19:01 -07:00
Niel Lebeck d2b96736e0 Pass SettingsHandler buffers by const ref instead of rvalue ref 2024-04-12 18:50:21 -07:00
Lioncash 88a973131c Common/SettingsHandler: Use std::string_view more
We don't need to enforce the use of std::string instances with
AddSetting(). We can accept views and only construct one string,
rather than three temporaries.
2023-12-11 07:54:43 -05:00
Pierre Bourdon e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
JosJuice 5d6f23e424 SettingsHandler: Don't output null bytes
https://bugs.dolphin-emu.org/issues/12019, take two.
2020-03-24 17:01:15 +01:00
Lioncash af576839d8 Common/SettingsHandler: Use std::string_view where applicable
Allows passed in strings to be non-allocating.
2019-07-16 04:15:25 -04:00
Lioncash 5677e5d74a SettingsHandler: Namespace code under the Common namespace
Adds another file in Common to the Common namespace.
2018-05-12 13:39:37 -04:00
Léo Lam 722d31124c SettingsHandler: Fix const correctness 2018-05-10 21:35:27 +02:00
Léo Lam 09d2afa91f SettingsHandler: Migrate to new filesystem interface
Change SettingsHandler to take a buffer instead of assuming that the
setting file to read is always on the host filesystem for more
flexibility and make it possible to use the new filesystem interface.
2018-05-10 21:35:27 +02:00
Lioncash c748158182 SettingsHandler: Make GenerateSerialNumber static
This doesn't depend on class internals.
2017-01-27 10:29:57 -05:00
Lioncash 98291cd843 SettingsHandler: Add Open and Save member functions 2017-01-27 10:29:49 -05:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
mathieui 3e283ea9f1 More asterisks 2016-01-21 21:16:51 +01:00
Tillmann Karras 30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Pierre Bourdon 664c8d30a0 Remove all trailing whitespaces from our codebase. 2014-03-29 11:05:44 +01:00
Lioncash 2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
Matthew Parlane 3fe05e0a9f Fix IniFile to use string& instead of char*
Also removes .c_str() usages where found.
2014-02-13 17:06:30 +13:00
Matthew Parlane 6b980cbf30 Tidy up SetupWiiMemory 2014-02-07 19:00:34 +13:00
Jasper St. Pierre 34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00