uppercase constant name v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 23 May 2021 21:22:02 +0200
branchv_0
changeset 5 9ddc9462e25b
parent 4 66c8a1783884
child 6 779897b055c6
uppercase constant name
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<writer::RelationalWriter> relationalWriter) : Mode(relationalWriter) {
 	}
 
 	static bool willInfer(std::vector<relpipe::reader::handlers::AttributeMetadata> 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
 
 }
 }