Exemplo n.º 1
0
/** @return a renamed key
  */
inline kdb::Key rename_key (kdb::Key k, std::string sourceName, std::string newDirName, bool verbose)
{
	std::string otherName = k.getName ();
	std::string baseName = otherName.substr (sourceName.length ());
	if (verbose) std::cout << "key: " << otherName << " will be renamed to: " << newDirName + baseName << std::endl;

	kdb::Key newKey = k.dup ();
	newKey.setName (newDirName + baseName);
	return newKey;
}
Exemplo n.º 2
0
	void visit(std::string name, unsigned long depth, kdb::Key k)
	{
		for (unsigned long i = 0; i<depth; ++i)
		{
			std::cout << "   ";
		}

		std::cout << name;

		if (k)
		{
			std::cout
				<< "(" << k.getName() << ") = "
				<< k.getString();
		}

		std::cout << std::endl;
	}