Use extern template for fxcrt::Split<StrType>.
Avoid potentially redundant instantiations as per other string
templates.
Change-Id: I5c349dded594011068e11aec17758b48bce31e31
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/87290
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/fx_string.cpp b/core/fxcrt/fx_string.cpp
index 9b86abb..46961d4 100644
--- a/core/fxcrt/fx_string.cpp
+++ b/core/fxcrt/fx_string.cpp
@@ -160,3 +160,12 @@
size_t DoubleToString(double d, char* buf) {
return ToString<double>(d, FXSYS_round, buf);
}
+
+namespace fxcrt {
+
+template std::vector<ByteString> Split<ByteString>(const ByteString& that,
+ ByteString::CharType ch);
+template std::vector<WideString> Split<WideString>(const WideString& that,
+ WideString::CharType ch);
+
+} // namespace fxcrt
diff --git a/core/fxcrt/fx_string.h b/core/fxcrt/fx_string.h
index 3fcc18e..3d036d6 100644
--- a/core/fxcrt/fx_string.h
+++ b/core/fxcrt/fx_string.h
@@ -46,6 +46,13 @@
return result;
}
+extern template std::vector<ByteString> Split<ByteString>(
+ const ByteString& that,
+ ByteString::CharType ch);
+extern template std::vector<WideString> Split<WideString>(
+ const WideString& that,
+ WideString::CharType ch);
+
} // namespace fxcrt
#endif // CORE_FXCRT_FX_STRING_H_