diff options
Diffstat (limited to 'include/ingen/Parser.hpp')
-rw-r--r-- | include/ingen/Parser.hpp | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/include/ingen/Parser.hpp b/include/ingen/Parser.hpp index f2cd951f..8db64104 100644 --- a/include/ingen/Parser.hpp +++ b/include/ingen/Parser.hpp @@ -17,20 +17,21 @@ #ifndef INGEN_PARSER_HPP #define INGEN_PARSER_HPP -#include "ingen/FilePath.hpp" -#include "ingen/Properties.hpp" // IWYU pragma: keep -#include "ingen/URI.hpp" -#include "ingen/ingen.h" -#include "raul/Path.hpp" // IWYU pragma: keep -#include "raul/Symbol.hpp" // IWYU pragma: keep - -#include <boost/optional/optional.hpp> - +#include <ingen/FilePath.hpp> +#include <ingen/Properties.hpp> +#include <ingen/URI.hpp> +#include <ingen/ingen.h> +#include <raul/Path.hpp> +#include <raul/Symbol.hpp> + +#include <optional> #include <set> #include <string> #include <utility> -namespace Sord { class World; } +namespace Sord { +class World; +} // namespace Sord namespace ingen { @@ -42,7 +43,8 @@ class World; @ingroup Ingen */ -class INGEN_API Parser { +class INGEN_API Parser +{ public: explicit Parser() = default; @@ -50,16 +52,16 @@ public: /** Record of a resource listed in a bundle manifest. */ struct ResourceRecord { - inline ResourceRecord(URI u, FilePath f) + ResourceRecord(URI u, FilePath f) : uri(std::move(u)), filename(std::move(f)) {} - inline bool operator<(const ResourceRecord& r) const { + bool operator<(const ResourceRecord& r) const { return uri < r.uri; } - URI uri; ///< URI of resource (e.g. a Graph) - FilePath filename; ///< Path of describing file (seeAlso) + URI uri; ///< URI of resource (e.g. a Graph) + FilePath filename; ///< Path of describing file (seeAlso) }; /** Find all resources of a given type listed in a manifest file. */ @@ -77,21 +79,21 @@ public: * @return whether or not load was successful. */ virtual bool parse_file( - World& world, - Interface& target, - const FilePath& path, - const boost::optional<raul::Path>& parent = boost::optional<raul::Path>(), - const boost::optional<raul::Symbol>& symbol = boost::optional<raul::Symbol>(), - const boost::optional<Properties>& data = boost::optional<Properties>()); - - virtual boost::optional<URI> parse_string( - World& world, - Interface& target, - const std::string& str, - const URI& base_uri, - const boost::optional<raul::Path>& parent = boost::optional<raul::Path>(), - const boost::optional<raul::Symbol>& symbol = boost::optional<raul::Symbol>(), - const boost::optional<Properties>& data = boost::optional<Properties>()); + World& world, + Interface& target, + const FilePath& path, + const std::optional<raul::Path>& parent = std::optional<raul::Path>(), + const std::optional<raul::Symbol>& symbol = std::optional<raul::Symbol>(), + const std::optional<Properties>& data = std::optional<Properties>()); + + virtual std::optional<URI> parse_string( + World& world, + Interface& target, + const std::string& str, + const URI& base_uri, + const std::optional<raul::Path>& parent = std::optional<raul::Path>(), + const std::optional<raul::Symbol>& symbol = std::optional<raul::Symbol>(), + const std::optional<Properties>& data = std::optional<Properties>()); }; } // namespace ingen |