Files
rippled/include/nudb/file.hpp
Vinnie Falco 79159ffd87 Squashed 'src/nudb/' content from commit 00adc6a
git-subtree-dir: src/nudb
git-subtree-split: 00adc6a4f16679a376f40c967f77dfa544c179c1
2016-09-29 19:24:12 -04:00

54 lines
1.0 KiB
C++

//
// Copyright (c) 2015-2016 Vinnie Falco (vinnie dot falco at gmail dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef NUDB_FILE_HPP
#define NUDB_FILE_HPP
#include <cstddef>
#include <string>
namespace nudb {
/// The type used to hold paths to files
using path_type = std::string;
/** Returns the best guess at the volume's block size.
@param path A path to a file on the device. The file does
not need to exist.
*/
inline
std::size_t
block_size(path_type const& path)
{
// A reasonable default for many SSD devices
return 4096;
}
/** File create and open modes.
These are used by @ref native_file.
*/
enum class file_mode
{
/// Open the file for sequential reads
scan,
/// Open the file for random reads
read,
/// Open the file for random reads and appending writes
append,
/// Open the file for random reads and writes
write
};
} // nudb
#endif