1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
#pragma once
// system
#include <memory>
#include <string>
namespace XdgUtils {
namespace DesktopEntry {
/**
* Utility class to handle 'string(s)' values in Desktop Entries.
* More details at: https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s04.html
*/
class DesktopEntryStringsValue {
public:
DesktopEntryStringsValue();
/**
* Create a instance from a DesktopEntry value
* @param data
*/
explicit DesktopEntryStringsValue(const std::string& data);
virtual ~DesktopEntryStringsValue();
/**
* @return total of strings contained
*/
unsigned long size() const;
/**
* Access string at <o>
* @param i
* @return string
*/
std::string& operator[](int i);
/**
* @return string list raw representation to be set on the DesktopEntry
*/
std::string dump();
/**
* Append <string> at the end of the list
* @param string
*/
void append(const std::string& string);
/**
* Remove item at <pos>
* @param pos
*/
void remove(int pos);
private:
struct Priv;
std::unique_ptr<Priv> priv;
};
}
}
|