mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
44 lines
975 B
C++
44 lines
975 B
C++
#pragma once
|
|
|
|
#include "platform/platform.hpp"
|
|
|
|
#include "base/macros.hpp"
|
|
|
|
#include <string>
|
|
|
|
namespace platform
|
|
{
|
|
namespace tests_support
|
|
{
|
|
// Scoped test directory in a writable dir.
|
|
class ScopedDir
|
|
{
|
|
public:
|
|
/// Creates test dir in a writable directory.
|
|
/// @param path Path for a testing directory, should be relative to writable-dir.
|
|
ScopedDir(std::string const & relativePath);
|
|
|
|
ScopedDir(ScopedDir const & parent, std::string const & name);
|
|
|
|
~ScopedDir();
|
|
|
|
void Reset() { m_reset = true; }
|
|
|
|
std::string const & GetFullPath() const { return m_fullPath; }
|
|
|
|
std::string const & GetRelativePath() const { return m_relativePath; }
|
|
|
|
bool Exists() const { return GetPlatform().IsFileExistsByFullPath(GetFullPath()); }
|
|
|
|
private:
|
|
std::string const m_fullPath;
|
|
std::string const m_relativePath;
|
|
bool m_reset;
|
|
|
|
DISALLOW_COPY_AND_MOVE(ScopedDir);
|
|
};
|
|
|
|
std::string DebugPrint(ScopedDir const & dir);
|
|
} // namespace tests_support
|
|
} // namespace platform
|