summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
Diffstat (limited to 'node')
-rw-r--r--node/Node.cpp5
-rw-r--r--node/Node.hpp11
2 files changed, 15 insertions, 1 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index fe8cfb18..c88741a6 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -182,6 +182,11 @@ unsigned long Node::LocalClient::send(const char *command)
}
}
+std::vector<std::string> Node::LocalClient::splitLine(const char *line)
+{
+ return Utils::split(line," ","\\","\"");
+}
+
struct _NodeImpl
{
RuntimeEnvironment renv;
diff --git a/node/Node.hpp b/node/Node.hpp
index 238b5fce..2f7d43ed 100644
--- a/node/Node.hpp
+++ b/node/Node.hpp
@@ -71,6 +71,15 @@ public:
unsigned long send(const char *command)
throw();
+ /**
+ * Split a line of results by space
+ *
+ * @param line Line to split
+ * @return Vector of fields
+ */
+ static std::vector<std::string> splitLine(const char *line);
+ static inline std::vector<std::string> splitLine(const std::string &line) { return splitLine(line.c_str()); }
+
private:
// LocalClient is not copyable
LocalClient(const LocalClient&);
@@ -140,7 +149,7 @@ public:
/**
* Get the ZeroTier version in major.minor.revision string format
- *
+ *
* @return Version in string form
*/
static const char *versionString()