.. _program_listing_file_src_pdfs_PDFCommons.hpp: Program Listing for File PDFCommons.hpp ======================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/pdfs/PDFCommons.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef PDFCOMMONS_HPP #define PDFCOMMONS_HPP #include #include #include 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