fix coding format

This commit is contained in:
Tomonobu Saito
2019-10-09 13:35:19 +09:00
parent 542c3ba872
commit 17f32f4ca1
3 changed files with 42 additions and 26 deletions
+15 -7
View File
@@ -62,20 +62,28 @@ class FileReader
std::size_t GetSize()
{
const boost::filesystem::path path(filepath);
try {
return std::size_t(boost::filesystem::file_size(path)) - ((fingerprint == FingerprintFlag::VerifyFingerprint) ? sizeof(util::FingerPrint) : 0);
try
{
return std::size_t(boost::filesystem::file_size(path)) -
((fingerprint == FingerprintFlag::VerifyFingerprint) ? sizeof(util::FingerPrint)
: 0);
}
catch (boost::filesystem::filesystem_error& ex) {
catch (boost::filesystem::filesystem_error &ex)
{
std::cout << ex.what() << std::endl;
throw;
}
}
/* Read one line */
template <typename T> void ReadLine(T *dest, const std::size_t count) {
if (0 < count) {
const auto &ios = input_stream.getline(reinterpret_cast<char *>(dest), count * sizeof(T));
for (std::size_t n = ios.gcount(); n < count; ++n) {
template <typename T> void ReadLine(T *dest, const std::size_t count)
{
if (0 < count)
{
const auto &ios =
input_stream.getline(reinterpret_cast<char *>(dest), count * sizeof(T));
for (std::size_t n = ios.gcount(); n < count; ++n)
{
reinterpret_cast<char *>(dest)[n] = '\0';
}
}