Program Listing for File PDFCommons.hpp
↰ Return to documentation for file (src/pdfs/PDFCommons.hpp)
#ifndef PDFCOMMONS_HPP
#define PDFCOMMONS_HPP
#include <cstdint>
#include <stdexcept>
#include <string_view>
namespace pdfs {
enum class SamplingMethods : std::uint8_t {
stopNearest,
stopBefore,
stopAfter,
stop50,
number,
poisson,
sorted,
none
};
enum class FileFormats : std::uint8_t {
basic,
advanced
};
inline auto samplingMethodName(const SamplingMethods method) -> std::string_view
{
switch (method)
{
case SamplingMethods::stopNearest: return "stop_nearest";
case SamplingMethods::stopBefore: return "stop_before";
case SamplingMethods::stopAfter: return "stop_after";
case SamplingMethods::stop50: return "stop_50";
case SamplingMethods::number: return "number";
case SamplingMethods::poisson: return "poisson";
case SamplingMethods::sorted: return "sorted_sampling";
case SamplingMethods::none: return "none";
}
throw std::logic_error("samplingMethodName: unrecognized sampling method"); // unreachable; exhaustive switch above
}
} // namespace pdfs
#endif // PDFCOMMONS_HPP