AnkitAggarwalPEC/tocc-1 — pull request #1 by AnkitAggarwalPEC (2014-07-28 15:55:25+00:00)
Title: issue#61

additional code for libtocc::database.cpp

IntFileInfo Database::get_using_traditional_path(std::string traditional_path)
{
unqlite_vm* vm;
// Auto release the pointer.
VMPointerHolder holder(&vm);

// Executing script.
compile_jx9(this->db_pointer, GET_FILE_SCRIPT, &vm);

std::string variable_traditional_path("traditional_path");
register_variable_in_vm(vm, variable_traditional_path, traditional_path);

execute_vm(vm);

return extract_file_from_vm(vm, "result");
}

addition code for libtocc::manager

FileInfo get_file_by_traditional_path(const char* traditional_path)
{
IntFileInfo info = this->private_data->database->get_using_traditional_path(traditional_path);
return to_external_file_info(&info, this->private_data->file_manager);
}