Make splitModuleNode reusable

It will become handy when parsing identityref as returned from sysrepo.
The code still assumes that it will never get a module-unqualified name.

Change-Id: I8014a5442c69a2098f8d1425233011fad47bf42e
diff --git a/src/utils.cpp b/src/utils.cpp
index 1ed25c7..dbfc647 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -53,6 +53,15 @@
     return schemaPath_{path.m_scope, decltype(schemaPath_::m_nodes)(path.m_nodes.begin(), path.m_nodes.end() - 1)};
 }
 
+ModuleNodePair splitModuleNode(const std::string& input)
+{
+    auto colonLocation = input.find_first_of(':');
+    if (colonLocation != std::string::npos) {
+        return ModuleNodePair{input.substr(0, colonLocation), input.substr(colonLocation + 1)};
+    }
+    throw std::logic_error("Internal error: got module-unqualified node name");
+}
+
 struct impl_leafDataTypeToString {
     std::string operator()(const yang::String)
     {