Enzo
Loading...
Searching...
No Matches
NetworkPath.h
1#pragma once
2
3#include "Engine/Core/Path.h"
4#include <cstddef>
5#include <string>
6#include <string_view>
7
8namespace enzo {
19class NetworkPath : public Path
20{
21 public:
23 NetworkPath() = default;
25 NetworkPath(const std::string& path);
27 NetworkPath(const char* path);
28
38 bool isValid() const override;
39
41 bool hasParameter() const;
42
44 std::string getParameter() const;
45
53 NetworkPath getNode() const;
54
62 static bool isValidFormatting(const std::string& pathString);
63
64 private:
70 static size_t parameterDelimiter(std::string_view pathString);
71};
72} // namespace enzo
A path that references a network entity, either a node or a parameter on a node.
Definition NetworkPath.h:20
NetworkPath getNode() const
Returns the node portion of the path with any parameter removed.
Definition NetworkPath.cpp:57
static bool isValidFormatting(const std::string &pathString)
Checks whether a string is a valid node or parameter reference.
Definition NetworkPath.cpp:30
bool hasParameter() const
Checks whether the path carries a parameter component.
Definition NetworkPath.cpp:46
bool isValid() const override
Runs every validation check and returns true if the path is a valid node or parameter reference.
Definition NetworkPath.cpp:44
NetworkPath()=default
Constructs an empty NetworkPath.
std::string getParameter() const
Returns the parameter name, or an empty string when the path references a node.
Definition NetworkPath.cpp:48
A default path class for creation and manipulation of tree-based paths.
Definition Path.h:14