# HG changeset patch # User František Kučera # Date 1621797722 -7200 # Node ID 9ddc9462e25bca59f32a85afe917efcd8a5636ca # Parent 66c8a17838841cad578f68fd3e3fe4f247e6cd5b uppercase constant name diff -r 66c8a1783884 -r 9ddc9462e25b src/MetadataMode.h --- a/src/MetadataMode.h Sun May 23 17:17:33 2021 +0200 +++ b/src/MetadataMode.h Sun May 23 21:22:02 2021 +0200 @@ -31,14 +31,14 @@ class MetadataMode : public Mode { private: - static std::wregex pattern; + static const std::wregex PATTERN; public: MetadataMode(shared_ptr relationalWriter) : Mode(relationalWriter) { } static bool willInfer(std::vector attributes) { - for (relpipe::reader::handlers::AttributeMetadata a : attributes) if (!std::regex_match(a.getAttributeName(), pattern)) return false; + for (relpipe::reader::handlers::AttributeMetadata a : attributes) if (!std::regex_match(a.getAttributeName(), PATTERN)) return false; return true; } @@ -48,7 +48,7 @@ std::wsmatch match; for (relpipe::reader::handlers::AttributeMetadata& am : attributes) { relpipe::common::type::StringX nameAndType = am.getAttributeName(); - if (std::regex_match(nameAndType, match, pattern)) writerMetadata.push_back({match[1], relationalWriter->toTypeId(match[2])}); + if (std::regex_match(nameAndType, match, PATTERN)) writerMetadata.push_back({match[1], relationalWriter->toTypeId(match[2])}); else throw relpipe::writer::RelpipeWriterException(L"Unable to find type in the attribute name: " + am.getAttributeName()); } @@ -60,7 +60,7 @@ } }; -std::wregex MetadataMode::pattern = std::wregex(L"(.*)::(.*)"); // name::type +const std::wregex MetadataMode::PATTERN = std::wregex(L"(.*)::(.*)"); // name::type } }