Skip to content

Commit

Permalink
improved list support
Browse files Browse the repository at this point in the history
  • Loading branch information
VogelPapaFinn committed Jan 11, 2023
1 parent 23ca276 commit 0a593c6
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

```
/*
* Hint:
* There are no attributes without a group. You cand find them in the [default] group.
* But you dont need to care about this, just handle them like they dont have a group.
* The lib does the job there!
*/
* Hint:
* There are no attributes without a group. You cant find them in the [default] group.
* But you don't need to care about this, just handle them like they don't have a group.
* The lib does the job there!
*/
// Constructor
// Constructor
// Opens the file 'file' or creates it, if it does not exists.
config_file(const std::string& file);
Expand Down Expand Up @@ -57,12 +57,14 @@ bool write(const std::string& name, const std::string& value, const std::string&
// Writes the attribute 'name' in the group 'group' and assigns the list 'value'.
// Creates a new group if 'group' does not exist.
// Returns 'true' if successful.
bool write_list(const std::string& name, const std::vector<std::string>& value);
template <typename T>
bool write_list(const std::string& name, const T& value);
// write
// Writes the attribute 'name' in the group default and assigns the list 'value'.
// Returns 'true' if successful.
bool write_list(const std::string& name, const std::vector<std::string>& value, const std::string& group);
template <typename T>
bool write_list(const std::string& name, const T& value, const std::string& group);
Expand All @@ -78,27 +80,29 @@ bool write_list(const std::string& name, const std::vector<std::string>& value,
// Returns std::nullopt when not successful.
[[nodiscard]] std::optional<std::string> get(const std::string& name) const;
// get_list
// get_list_as_vector
// Returns the list-value of the attribute 'name' in the group 'group'
// as std::vector.
// Returns empty vector when not successful.
[[nodiscard]] std::vector<std::string> get_list(const std::string& name, const std::string& group) const;
std::vector<std::string> get_list_as_vector(const std::string& name, const std::string& group) const;
// get_list
// get_list_as_vector
// Returns the list-value of the attribute 'name' in the group 'group'
// as std::vector.
// Returns empty vector when not successful.
[[nodiscard]] std::vector<std::string> get_list(const std::string& name) const;
std::vector<std::string> get_list_as_vector(const std::string& name) const;
// get_raw_list
// Returns the list-value as string of the attribute 'name' in the group 'group'
// Returns std::nullopt when not successful.
[[nodiscard]] std::optional<std::string> get_raw_list(const std::string& name) const;
std::optional<std::string> get_raw_list(const std::string& name) const;
// get_raw_list
// Returns the list-value as string of the attribute 'name' in the group default
// Returns std::nullopt when not successful.
[[nodiscard]] std::optional<std::string> get_raw_list(const std::string& name, const std::string& group) const;
std::optional<std::string> get_raw_list(const std::string& name, const std::string& group) const;
Expand Down

0 comments on commit 0a593c6

Please sign in to comment.