mirror of
https://github.com/audacity/linuxdeploy.git
synced 2026-04-12 21:25:04 -05:00
Move type definitions into class
This commit is contained in:
@@ -14,12 +14,6 @@ namespace bf = boost::filesystem;
|
||||
namespace linuxdeploy {
|
||||
namespace core {
|
||||
namespace desktopfile {
|
||||
// describes a single section
|
||||
typedef std::unordered_map<std::string, DesktopFileEntry> section_t;
|
||||
|
||||
// describes all sections in the desktop file
|
||||
typedef std::unordered_map<std::string, section_t> sections_t;
|
||||
|
||||
class DesktopFileReader::PrivateData {
|
||||
public:
|
||||
bf::path path;
|
||||
@@ -152,7 +146,7 @@ namespace linuxdeploy {
|
||||
return d->path;
|
||||
}
|
||||
|
||||
section_t DesktopFileReader::operator[](const std::string& name) {
|
||||
DesktopFileReader::section_t DesktopFileReader::operator[](const std::string& name) {
|
||||
auto it = d->sections.find(name);
|
||||
|
||||
// the map would lazy-initialize a new entry in case the section doesn't exist
|
||||
|
||||
@@ -21,6 +21,13 @@ namespace linuxdeploy {
|
||||
|
||||
std::shared_ptr<PrivateData> d;
|
||||
|
||||
public:
|
||||
// describes a single section
|
||||
typedef std::unordered_map<std::string, DesktopFileEntry> section_t;
|
||||
|
||||
// describes all sections in the desktop file
|
||||
typedef std::unordered_map<std::string, section_t> sections_t;
|
||||
|
||||
public:
|
||||
// default constructor
|
||||
DesktopFileReader();
|
||||
@@ -55,7 +62,7 @@ namespace linuxdeploy {
|
||||
|
||||
// get a specific section from the parsed data
|
||||
// throws std::range_error if section does not exist
|
||||
std::unordered_map<std::string, DesktopFileEntry> operator[](const std::string& name);
|
||||
section_t operator[](const std::string& name);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user