Implement DataQuery

For now, the DataQuery class includes the listKeys method, which will be
used in the parser for tab-completion of values of keys.

The listKeys method uses similar arguments as many methods from the
Schema interface do. This is due to how parsing works: when I parse
lists I won't get the full list instance until all keys are typed.
That's why I can't get the full path to the list: it can't be a full
data path until all keys are known.

I tried many different return types of the method. The first iteration
used just a string to string map. That didn't work well, because
discarding type info meant that I needed to quote strings in THIS
method. And that didn't go well when trying to integrate this to the
parser, because I couldn't compare quoted strings with unquoted strings.

The next return type I tried - a set of string to leaf_data_ maps - was
better. It doesn't discard type info and that makes it possible to
compare in the parser. However, I didn't really make use of an ordered
container, so I changed the type to a vector.

The various implementations of this method were pretty straightforward.
They usually just retrieved all the instances from the datastore with
DatastoreAccess::getItems and then used some sort of an algorithm to
transform the instances into the desired return type. However, there was
a problem with this approach: it is difficult to get ONLY the instances,
and no other data. This means that it is unsuitable to use getItems for this, because:
a) it always works recursively
b) even if it didn't Netconf would still give me more data than I
wanted.

It is possible to create an XML filter, so that no data has to be
discarded, but it's only possible in Netconf and not sysrepo. This
difference is going to be (hopefully) removed with sysrepo2. I decided
to implement a datastore-specific method, where both sysrepo and netconf
use their own best implementation.

Change-Id: I2c978762d3a78286b4f7fb97e16118772ddeb7bc
diff --git a/src/data_query.cpp b/src/data_query.cpp
new file mode 100644
index 0000000..be979ff
--- /dev/null
+++ b/src/data_query.cpp
@@ -0,0 +1,18 @@
+#include "data_query.hpp"
+#include "datastore_access.hpp"
+#include "schema.hpp"
+#include "utils.hpp"
+
+
+DataQuery::DataQuery(DatastoreAccess& datastore)
+    : m_datastore(datastore)
+{
+    m_schema = m_datastore.schema();
+}
+
+std::vector<ListInstance> DataQuery::listKeys(const dataPath_& location, const ModuleNodePair& node) const
+{
+    auto listPath = joinPaths(pathToDataString(location, Prefixes::Always), fullNodeName(location, node));
+
+    return m_datastore.listInstances(listPath);
+}