Remove base_export.h
This mucked up all the formatting alignment, but I'm going to leave it wrong in
this CL and then globally clang-format in the next one to keep the changes
separate.
Change-Id: I53c836a83d26edcae9b97831844f7a6b350cfd14
Reviewed-on: https://gn-review.googlesource.com/1624
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
diff --git a/base/strings/string16.h b/base/strings/string16.h
index 570a6d5..b143375 100644
--- a/base/strings/string16.h
+++ b/base/strings/string16.h
@@ -33,7 +33,6 @@
#include <functional>
#include <string>
-#include "base/base_export.h"
#include "build_config.h"
#if defined(WCHAR_T_IS_UTF16)
@@ -56,12 +55,12 @@
// char16 versions of the functions required by string16_char_traits; these
// are based on the wide character functions of similar names ("w" or "wcs"
// instead of "c16").
-BASE_EXPORT int c16memcmp(const char16* s1, const char16* s2, size_t n);
-BASE_EXPORT size_t c16len(const char16* s);
-BASE_EXPORT const char16* c16memchr(const char16* s, char16 c, size_t n);
-BASE_EXPORT char16* c16memmove(char16* s1, const char16* s2, size_t n);
-BASE_EXPORT char16* c16memcpy(char16* s1, const char16* s2, size_t n);
-BASE_EXPORT char16* c16memset(char16* s, char16 c, size_t n);
+int c16memcmp(const char16* s1, const char16* s2, size_t n);
+size_t c16len(const char16* s);
+const char16* c16memchr(const char16* s, char16 c, size_t n);
+char16* c16memmove(char16* s1, const char16* s2, size_t n);
+char16* c16memcpy(char16* s1, const char16* s2, size_t n);
+char16* c16memset(char16* s, char16 c, size_t n);
// This namespace contains the implementation of base::string16 along with
// things that need to be found via argument-dependent lookup from a
@@ -146,11 +145,11 @@
namespace string16_internals {
-BASE_EXPORT extern std::ostream& operator<<(std::ostream& out,
+extern std::ostream& operator<<(std::ostream& out,
const string16& str);
// This is required by googletest to print a readable output on test failures.
-BASE_EXPORT extern void PrintTo(const string16& str, std::ostream* out);
+extern void PrintTo(const string16& str, std::ostream* out);
} // namespace string16_internals
@@ -195,7 +194,7 @@
//
// TODO(mark): File this bug with Apple and update this note with a bug number.
-extern template class BASE_EXPORT
+extern template class
std::basic_string<base::char16,
base::string16_internals::string16_char_traits>;
diff --git a/base/strings/string_number_conversions.h b/base/strings/string_number_conversions.h
index 4eb870e..d31f09b 100644
--- a/base/strings/string_number_conversions.h
+++ b/base/strings/string_number_conversions.h
@@ -11,7 +11,6 @@
#include <string>
#include <vector>
-#include "base/base_export.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "build_config.h"
@@ -41,18 +40,18 @@
// Number -> string conversions ------------------------------------------------
// Ignores locale! see warning above.
-BASE_EXPORT std::string NumberToString(int value);
-BASE_EXPORT string16 NumberToString16(int value);
-BASE_EXPORT std::string NumberToString(unsigned int value);
-BASE_EXPORT string16 NumberToString16(unsigned int value);
-BASE_EXPORT std::string NumberToString(long value);
-BASE_EXPORT string16 NumberToString16(long value);
-BASE_EXPORT std::string NumberToString(unsigned long value);
-BASE_EXPORT string16 NumberToString16(unsigned long value);
-BASE_EXPORT std::string NumberToString(long long value);
-BASE_EXPORT string16 NumberToString16(long long value);
-BASE_EXPORT std::string NumberToString(unsigned long long value);
-BASE_EXPORT string16 NumberToString16(unsigned long long value);
+std::string NumberToString(int value);
+string16 NumberToString16(int value);
+std::string NumberToString(unsigned int value);
+string16 NumberToString16(unsigned int value);
+std::string NumberToString(long value);
+string16 NumberToString16(long value);
+std::string NumberToString(unsigned long value);
+string16 NumberToString16(unsigned long value);
+std::string NumberToString(long long value);
+string16 NumberToString16(long long value);
+std::string NumberToString(unsigned long long value);
+string16 NumberToString16(unsigned long long value);
// Type-specific naming for backwards compatibility.
//
@@ -95,20 +94,20 @@
// - Empty string. |*output| will be set to 0.
// WARNING: Will write to |output| even when returning false.
// Read the comments above carefully.
-BASE_EXPORT bool StringToInt(StringPiece input, int* output);
-BASE_EXPORT bool StringToInt(StringPiece16 input, int* output);
+bool StringToInt(StringPiece input, int* output);
+bool StringToInt(StringPiece16 input, int* output);
-BASE_EXPORT bool StringToUint(StringPiece input, unsigned* output);
-BASE_EXPORT bool StringToUint(StringPiece16 input, unsigned* output);
+bool StringToUint(StringPiece input, unsigned* output);
+bool StringToUint(StringPiece16 input, unsigned* output);
-BASE_EXPORT bool StringToInt64(StringPiece input, int64_t* output);
-BASE_EXPORT bool StringToInt64(StringPiece16 input, int64_t* output);
+bool StringToInt64(StringPiece input, int64_t* output);
+bool StringToInt64(StringPiece16 input, int64_t* output);
-BASE_EXPORT bool StringToUint64(StringPiece input, uint64_t* output);
-BASE_EXPORT bool StringToUint64(StringPiece16 input, uint64_t* output);
+bool StringToUint64(StringPiece input, uint64_t* output);
+bool StringToUint64(StringPiece16 input, uint64_t* output);
-BASE_EXPORT bool StringToSizeT(StringPiece input, size_t* output);
-BASE_EXPORT bool StringToSizeT(StringPiece16 input, size_t* output);
+bool StringToSizeT(StringPiece input, size_t* output);
+bool StringToSizeT(StringPiece16 input, size_t* output);
// Hex encoding ----------------------------------------------------------------
@@ -118,35 +117,35 @@
// you suspect that the data you want to format might be large, the absolute
// max size for |size| should be is
// std::numeric_limits<size_t>::max() / 2
-BASE_EXPORT std::string HexEncode(const void* bytes, size_t size);
+std::string HexEncode(const void* bytes, size_t size);
// Best effort conversion, see StringToInt above for restrictions.
// Will only successful parse hex values that will fit into |output|, i.e.
// -0x80000000 < |input| < 0x7FFFFFFF.
-BASE_EXPORT bool HexStringToInt(StringPiece input, int* output);
+bool HexStringToInt(StringPiece input, int* output);
// Best effort conversion, see StringToInt above for restrictions.
// Will only successful parse hex values that will fit into |output|, i.e.
// 0x00000000 < |input| < 0xFFFFFFFF.
// The string is not required to start with 0x.
-BASE_EXPORT bool HexStringToUInt(StringPiece input, uint32_t* output);
+bool HexStringToUInt(StringPiece input, uint32_t* output);
// Best effort conversion, see StringToInt above for restrictions.
// Will only successful parse hex values that will fit into |output|, i.e.
// -0x8000000000000000 < |input| < 0x7FFFFFFFFFFFFFFF.
-BASE_EXPORT bool HexStringToInt64(StringPiece input, int64_t* output);
+bool HexStringToInt64(StringPiece input, int64_t* output);
// Best effort conversion, see StringToInt above for restrictions.
// Will only successful parse hex values that will fit into |output|, i.e.
// 0x0000000000000000 < |input| < 0xFFFFFFFFFFFFFFFF.
// The string is not required to start with 0x.
-BASE_EXPORT bool HexStringToUInt64(StringPiece input, uint64_t* output);
+bool HexStringToUInt64(StringPiece input, uint64_t* output);
// Similar to the previous functions, except that output is a vector of bytes.
// |*output| will contain as many bytes as were successfully parsed prior to the
// error. There is no overflow, but input.size() must be evenly divisible by 2.
// Leading 0x or +/- are not allowed.
-BASE_EXPORT bool HexStringToBytes(StringPiece input,
+bool HexStringToBytes(StringPiece input,
std::vector<uint8_t>* output);
} // namespace base
diff --git a/base/strings/string_piece.cc b/base/strings/string_piece.cc
index c82a223..be22261 100644
--- a/base/strings/string_piece.cc
+++ b/base/strings/string_piece.cc
@@ -254,7 +254,7 @@
}
// 16-bit brute-force version.
-BASE_EXPORT size_t find_first_not_of(const StringPiece16& self,
+size_t find_first_not_of(const StringPiece16& self,
const StringPiece16& s,
size_t pos) {
if (self.size() == 0)
diff --git a/base/strings/string_piece.h b/base/strings/string_piece.h
index 775ea7c..6b19b80 100644
--- a/base/strings/string_piece.h
+++ b/base/strings/string_piece.h
@@ -27,7 +27,6 @@
#include <iosfwd>
#include <string>
-#include "base/base_export.h"
#include "base/logging.h"
#include "base/strings/char_traits.h"
#include "base/strings/string16.h"
@@ -46,105 +45,105 @@
// template internal to the .cc file.
namespace internal {
-BASE_EXPORT void CopyToString(const StringPiece& self, std::string* target);
-BASE_EXPORT void CopyToString(const StringPiece16& self, string16* target);
+void CopyToString(const StringPiece& self, std::string* target);
+void CopyToString(const StringPiece16& self, string16* target);
-BASE_EXPORT void AppendToString(const StringPiece& self, std::string* target);
-BASE_EXPORT void AppendToString(const StringPiece16& self, string16* target);
+void AppendToString(const StringPiece& self, std::string* target);
+void AppendToString(const StringPiece16& self, string16* target);
-BASE_EXPORT size_t copy(const StringPiece& self,
+size_t copy(const StringPiece& self,
char* buf,
size_t n,
size_t pos);
-BASE_EXPORT size_t copy(const StringPiece16& self,
+size_t copy(const StringPiece16& self,
char16* buf,
size_t n,
size_t pos);
-BASE_EXPORT size_t find(const StringPiece& self,
+size_t find(const StringPiece& self,
const StringPiece& s,
size_t pos);
-BASE_EXPORT size_t find(const StringPiece16& self,
+size_t find(const StringPiece16& self,
const StringPiece16& s,
size_t pos);
-BASE_EXPORT size_t find(const StringPiece& self,
+size_t find(const StringPiece& self,
char c,
size_t pos);
-BASE_EXPORT size_t find(const StringPiece16& self,
+size_t find(const StringPiece16& self,
char16 c,
size_t pos);
-BASE_EXPORT size_t rfind(const StringPiece& self,
+size_t rfind(const StringPiece& self,
const StringPiece& s,
size_t pos);
-BASE_EXPORT size_t rfind(const StringPiece16& self,
+size_t rfind(const StringPiece16& self,
const StringPiece16& s,
size_t pos);
-BASE_EXPORT size_t rfind(const StringPiece& self,
+size_t rfind(const StringPiece& self,
char c,
size_t pos);
-BASE_EXPORT size_t rfind(const StringPiece16& self,
+size_t rfind(const StringPiece16& self,
char16 c,
size_t pos);
-BASE_EXPORT size_t find_first_of(const StringPiece& self,
+size_t find_first_of(const StringPiece& self,
const StringPiece& s,
size_t pos);
-BASE_EXPORT size_t find_first_of(const StringPiece16& self,
+size_t find_first_of(const StringPiece16& self,
const StringPiece16& s,
size_t pos);
-BASE_EXPORT size_t find_first_not_of(const StringPiece& self,
+size_t find_first_not_of(const StringPiece& self,
const StringPiece& s,
size_t pos);
-BASE_EXPORT size_t find_first_not_of(const StringPiece16& self,
+size_t find_first_not_of(const StringPiece16& self,
const StringPiece16& s,
size_t pos);
-BASE_EXPORT size_t find_first_not_of(const StringPiece& self,
+size_t find_first_not_of(const StringPiece& self,
char c,
size_t pos);
-BASE_EXPORT size_t find_first_not_of(const StringPiece16& self,
+size_t find_first_not_of(const StringPiece16& self,
char16 c,
size_t pos);
-BASE_EXPORT size_t find_last_of(const StringPiece& self,
+size_t find_last_of(const StringPiece& self,
const StringPiece& s,
size_t pos);
-BASE_EXPORT size_t find_last_of(const StringPiece16& self,
+size_t find_last_of(const StringPiece16& self,
const StringPiece16& s,
size_t pos);
-BASE_EXPORT size_t find_last_of(const StringPiece& self,
+size_t find_last_of(const StringPiece& self,
char c,
size_t pos);
-BASE_EXPORT size_t find_last_of(const StringPiece16& self,
+size_t find_last_of(const StringPiece16& self,
char16 c,
size_t pos);
-BASE_EXPORT size_t find_last_not_of(const StringPiece& self,
+size_t find_last_not_of(const StringPiece& self,
const StringPiece& s,
size_t pos);
-BASE_EXPORT size_t find_last_not_of(const StringPiece16& self,
+size_t find_last_not_of(const StringPiece16& self,
const StringPiece16& s,
size_t pos);
-BASE_EXPORT size_t find_last_not_of(const StringPiece16& self,
+size_t find_last_not_of(const StringPiece16& self,
char16 c,
size_t pos);
-BASE_EXPORT size_t find_last_not_of(const StringPiece& self,
+size_t find_last_not_of(const StringPiece& self,
char c,
size_t pos);
-BASE_EXPORT StringPiece substr(const StringPiece& self,
+StringPiece substr(const StringPiece& self,
size_t pos,
size_t n);
-BASE_EXPORT StringPiece16 substr(const StringPiece16& self,
+StringPiece16 substr(const StringPiece16& self,
size_t pos,
size_t n);
#if DCHECK_IS_ON()
// Asserts that begin <= end to catch some errors with iterator usage.
-BASE_EXPORT void AssertIteratorsInOrder(std::string::const_iterator begin,
+void AssertIteratorsInOrder(std::string::const_iterator begin,
std::string::const_iterator end);
-BASE_EXPORT void AssertIteratorsInOrder(string16::const_iterator begin,
+void AssertIteratorsInOrder(string16::const_iterator begin,
string16::const_iterator end);
#endif
@@ -382,13 +381,13 @@
// MSVC doesn't like complex extern templates and DLLs.
#if !defined(COMPILER_MSVC)
-extern template class BASE_EXPORT BasicStringPiece<std::string>;
-extern template class BASE_EXPORT BasicStringPiece<string16>;
+extern template class BasicStringPiece<std::string>;
+extern template class BasicStringPiece<string16>;
#endif
// StingPiece operators --------------------------------------------------------
-BASE_EXPORT bool operator==(const StringPiece& x, const StringPiece& y);
+bool operator==(const StringPiece& x, const StringPiece& y);
inline bool operator!=(const StringPiece& x, const StringPiece& y) {
return !(x == y);
@@ -444,7 +443,7 @@
return !(x < y);
}
-BASE_EXPORT std::ostream& operator<<(std::ostream& o,
+std::ostream& operator<<(std::ostream& o,
const StringPiece& piece);
// Hashing ---------------------------------------------------------------------
diff --git a/base/strings/string_split.h b/base/strings/string_split.h
index 24b9dfa..1a41d2e 100644
--- a/base/strings/string_split.h
+++ b/base/strings/string_split.h
@@ -9,7 +9,6 @@
#include <utility>
#include <vector>
-#include "base/base_export.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
@@ -43,12 +42,12 @@
//
// std::vector<std::string> tokens = base::SplitString(
// input, ",;", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
-BASE_EXPORT std::vector<std::string> SplitString(
+std::vector<std::string> SplitString(
StringPiece input,
StringPiece separators,
WhitespaceHandling whitespace,
SplitResult result_type);
-BASE_EXPORT std::vector<string16> SplitString(
+std::vector<string16> SplitString(
StringPiece16 input,
StringPiece16 separators,
WhitespaceHandling whitespace,
@@ -66,12 +65,12 @@
// base::KEEP_WHITESPACE,
// base::SPLIT_WANT_NONEMPTY)) {
// ...
-BASE_EXPORT std::vector<StringPiece> SplitStringPiece(
+std::vector<StringPiece> SplitStringPiece(
StringPiece input,
StringPiece separators,
WhitespaceHandling whitespace,
SplitResult result_type);
-BASE_EXPORT std::vector<StringPiece16> SplitStringPiece(
+std::vector<StringPiece16> SplitStringPiece(
StringPiece16 input,
StringPiece16 separators,
WhitespaceHandling whitespace,
@@ -83,19 +82,19 @@
// removes whitespace leading each key and trailing each value. Returns true
// only if each pair has a non-empty key and value. |key_value_pairs| will
// include ("","") pairs for entries without |key_value_delimiter|.
-BASE_EXPORT bool SplitStringIntoKeyValuePairs(StringPiece input,
+bool SplitStringIntoKeyValuePairs(StringPiece input,
char key_value_delimiter,
char key_value_pair_delimiter,
StringPairs* key_value_pairs);
// Similar to SplitString, but use a substring delimiter instead of a list of
// characters that are all possible delimiters.
-BASE_EXPORT std::vector<string16> SplitStringUsingSubstr(
+std::vector<string16> SplitStringUsingSubstr(
StringPiece16 input,
StringPiece16 delimiter,
WhitespaceHandling whitespace,
SplitResult result_type);
-BASE_EXPORT std::vector<std::string> SplitStringUsingSubstr(
+std::vector<std::string> SplitStringUsingSubstr(
StringPiece input,
StringPiece delimiter,
WhitespaceHandling whitespace,
@@ -113,12 +112,12 @@
// base::KEEP_WHITESPACE,
// base::SPLIT_WANT_NONEMPTY)) {
// ...
-BASE_EXPORT std::vector<StringPiece16> SplitStringPieceUsingSubstr(
+std::vector<StringPiece16> SplitStringPieceUsingSubstr(
StringPiece16 input,
StringPiece16 delimiter,
WhitespaceHandling whitespace,
SplitResult result_type);
-BASE_EXPORT std::vector<StringPiece> SplitStringPieceUsingSubstr(
+std::vector<StringPiece> SplitStringPieceUsingSubstr(
StringPiece input,
StringPiece delimiter,
WhitespaceHandling whitespace,
diff --git a/base/strings/string_util.h b/base/strings/string_util.h
index eaef690..98197d6 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -16,7 +16,6 @@
#include <string>
#include <vector>
-#include "base/base_export.h"
#include "base/compiler_specific.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h" // For implicit conversions.
@@ -60,8 +59,8 @@
// long as |dst_size| is not 0. Returns the length of |src| in characters.
// If the return value is >= dst_size, then the output was truncated.
// NOTE: All sizes are in number of characters, NOT in bytes.
-BASE_EXPORT size_t strlcpy(char* dst, const char* src, size_t dst_size);
-BASE_EXPORT size_t wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size);
+size_t strlcpy(char* dst, const char* src, size_t dst_size);
+size_t wcslcpy(wchar_t* dst, const wchar_t* src, size_t dst_size);
// Scan a wprintf format string to determine whether it's portable across a
// variety of systems. This function only checks that the conversion
@@ -84,7 +83,7 @@
// working with wprintf.
//
// This function is intended to be called from base::vswprintf.
-BASE_EXPORT bool IsWprintfFormatPortable(const wchar_t* format);
+bool IsWprintfFormatPortable(const wchar_t* format);
// ASCII-specific tolower. The standard library's tolower is locale sensitive,
// so we don't want to use it here.
@@ -105,12 +104,12 @@
}
// Converts the given string to it's ASCII-lowercase equivalent.
-BASE_EXPORT std::string ToLowerASCII(StringPiece str);
-BASE_EXPORT string16 ToLowerASCII(StringPiece16 str);
+std::string ToLowerASCII(StringPiece str);
+string16 ToLowerASCII(StringPiece16 str);
// Converts the given string to it's ASCII-uppercase equivalent.
-BASE_EXPORT std::string ToUpperASCII(StringPiece str);
-BASE_EXPORT string16 ToUpperASCII(StringPiece16 str);
+std::string ToUpperASCII(StringPiece str);
+string16 ToUpperASCII(StringPiece16 str);
// Functor for case-insensitive ASCII comparisons for STL algorithms like
// std::search.
@@ -134,33 +133,33 @@
// (unlike strcasecmp which can return values greater or less than 1/-1). For
// full Unicode support, use base::i18n::ToLower or base::i18h::FoldCase
// and then just call the normal string operators on the result.
-BASE_EXPORT int CompareCaseInsensitiveASCII(StringPiece a, StringPiece b);
-BASE_EXPORT int CompareCaseInsensitiveASCII(StringPiece16 a, StringPiece16 b);
+int CompareCaseInsensitiveASCII(StringPiece a, StringPiece b);
+int CompareCaseInsensitiveASCII(StringPiece16 a, StringPiece16 b);
// Equality for ASCII case-insensitive comparisons. For full Unicode support,
// use base::i18n::ToLower or base::i18h::FoldCase and then compare with either
// == or !=.
-BASE_EXPORT bool EqualsCaseInsensitiveASCII(StringPiece a, StringPiece b);
-BASE_EXPORT bool EqualsCaseInsensitiveASCII(StringPiece16 a, StringPiece16 b);
+bool EqualsCaseInsensitiveASCII(StringPiece a, StringPiece b);
+bool EqualsCaseInsensitiveASCII(StringPiece16 a, StringPiece16 b);
// Contains the set of characters representing whitespace in the corresponding
// encoding. Null-terminated. The ASCII versions are the whitespaces as defined
// by HTML5, and don't include control characters.
-BASE_EXPORT extern const wchar_t kWhitespaceWide[]; // Includes Unicode.
-BASE_EXPORT extern const char16 kWhitespaceUTF16[]; // Includes Unicode.
-BASE_EXPORT extern const char kWhitespaceASCII[];
-BASE_EXPORT extern const char16 kWhitespaceASCIIAs16[]; // No unicode.
+extern const wchar_t kWhitespaceWide[]; // Includes Unicode.
+extern const char16 kWhitespaceUTF16[]; // Includes Unicode.
+extern const char kWhitespaceASCII[];
+extern const char16 kWhitespaceASCIIAs16[]; // No unicode.
// Null-terminated string representing the UTF-8 byte order mark.
-BASE_EXPORT extern const char kUtf8ByteOrderMark[];
+extern const char kUtf8ByteOrderMark[];
// Removes characters in |remove_chars| from anywhere in |input|. Returns true
// if any characters were removed. |remove_chars| must be null-terminated.
// NOTE: Safe to use the same variable for both |input| and |output|.
-BASE_EXPORT bool RemoveChars(const string16& input,
+bool RemoveChars(const string16& input,
StringPiece16 remove_chars,
string16* output);
-BASE_EXPORT bool RemoveChars(const std::string& input,
+bool RemoveChars(const std::string& input,
StringPiece remove_chars,
std::string* output);
@@ -169,11 +168,11 @@
// the |replace_with| string. Returns true if any characters were replaced.
// |replace_chars| must be null-terminated.
// NOTE: Safe to use the same variable for both |input| and |output|.
-BASE_EXPORT bool ReplaceChars(const string16& input,
+bool ReplaceChars(const string16& input,
StringPiece16 replace_chars,
const string16& replace_with,
string16* output);
-BASE_EXPORT bool ReplaceChars(const std::string& input,
+bool ReplaceChars(const std::string& input,
StringPiece replace_chars,
const std::string& replace_with,
std::string* output);
@@ -191,25 +190,25 @@
//
// It is safe to use the same variable for both |input| and |output| (this is
// the normal usage to trim in-place).
-BASE_EXPORT bool TrimString(const string16& input,
+bool TrimString(const string16& input,
StringPiece16 trim_chars,
string16* output);
-BASE_EXPORT bool TrimString(const std::string& input,
+bool TrimString(const std::string& input,
StringPiece trim_chars,
std::string* output);
// StringPiece versions of the above. The returned pieces refer to the original
// buffer.
-BASE_EXPORT StringPiece16 TrimString(StringPiece16 input,
+StringPiece16 TrimString(StringPiece16 input,
StringPiece16 trim_chars,
TrimPositions positions);
-BASE_EXPORT StringPiece TrimString(StringPiece input,
+StringPiece TrimString(StringPiece input,
StringPiece trim_chars,
TrimPositions positions);
// Truncates a string to the nearest UTF-8 character that will leave
// the string less than or equal to the specified byte size.
-BASE_EXPORT void TruncateUTF8ToByteSize(const std::string& input,
+void TruncateUTF8ToByteSize(const std::string& input,
const size_t byte_size,
std::string* output);
@@ -220,15 +219,15 @@
//
// The std::string versions return where whitespace was found.
// NOTE: Safe to use the same variable for both input and output.
-BASE_EXPORT TrimPositions TrimWhitespace(const string16& input,
+TrimPositions TrimWhitespace(const string16& input,
TrimPositions positions,
string16* output);
-BASE_EXPORT StringPiece16 TrimWhitespace(StringPiece16 input,
+StringPiece16 TrimWhitespace(StringPiece16 input,
TrimPositions positions);
-BASE_EXPORT TrimPositions TrimWhitespaceASCII(const std::string& input,
+TrimPositions TrimWhitespaceASCII(const std::string& input,
TrimPositions positions,
std::string* output);
-BASE_EXPORT StringPiece TrimWhitespaceASCII(StringPiece input,
+StringPiece TrimWhitespaceASCII(StringPiece input,
TrimPositions positions);
// Searches for CR or LF characters. Removes all contiguous whitespace
@@ -239,17 +238,17 @@
// (2) If |trim_sequences_with_line_breaks| is true, any other whitespace
// sequences containing a CR or LF are trimmed.
// (3) All other whitespace sequences are converted to single spaces.
-BASE_EXPORT string16 CollapseWhitespace(
+string16 CollapseWhitespace(
const string16& text,
bool trim_sequences_with_line_breaks);
-BASE_EXPORT std::string CollapseWhitespaceASCII(
+std::string CollapseWhitespaceASCII(
const std::string& text,
bool trim_sequences_with_line_breaks);
// Returns true if |input| is empty or contains only characters found in
// |characters|.
-BASE_EXPORT bool ContainsOnlyChars(StringPiece input, StringPiece characters);
-BASE_EXPORT bool ContainsOnlyChars(StringPiece16 input,
+bool ContainsOnlyChars(StringPiece input, StringPiece characters);
+bool ContainsOnlyChars(StringPiece16 input,
StringPiece16 characters);
// Returns true if the specified string matches the criteria. How can a wide
@@ -266,24 +265,24 @@
//
// IsStringASCII assumes the input is likely all ASCII, and does not leave early
// if it is not the case.
-BASE_EXPORT bool IsStringUTF8(StringPiece str);
-BASE_EXPORT bool IsStringASCII(StringPiece str);
-BASE_EXPORT bool IsStringASCII(StringPiece16 str);
+bool IsStringUTF8(StringPiece str);
+bool IsStringASCII(StringPiece str);
+bool IsStringASCII(StringPiece16 str);
#if defined(WCHAR_T_IS_UTF32)
-BASE_EXPORT bool IsStringASCII(WStringPiece str);
+bool IsStringASCII(WStringPiece str);
#endif
// Compare the lower-case form of the given string against the given
// previously-lower-cased ASCII string (typically a constant).
-BASE_EXPORT bool LowerCaseEqualsASCII(StringPiece str,
+bool LowerCaseEqualsASCII(StringPiece str,
StringPiece lowecase_ascii);
-BASE_EXPORT bool LowerCaseEqualsASCII(StringPiece16 str,
+bool LowerCaseEqualsASCII(StringPiece16 str,
StringPiece lowecase_ascii);
// Performs a case-sensitive string compare of the given 16-bit string against
// the given 8-bit ASCII string (typically a constant). The behavior is
// undefined if the |ascii| string is not ASCII.
-BASE_EXPORT bool EqualsASCII(StringPiece16 str, StringPiece ascii);
+bool EqualsASCII(StringPiece16 str, StringPiece ascii);
// Indicates case sensitivity of comparisons. Only ASCII case insensitivity
// is supported. Full Unicode case-insensitive conversions would need to go in
@@ -298,16 +297,16 @@
INSENSITIVE_ASCII,
};
-BASE_EXPORT bool StartsWith(StringPiece str,
+bool StartsWith(StringPiece str,
StringPiece search_for,
CompareCase case_sensitivity);
-BASE_EXPORT bool StartsWith(StringPiece16 str,
+bool StartsWith(StringPiece16 str,
StringPiece16 search_for,
CompareCase case_sensitivity);
-BASE_EXPORT bool EndsWith(StringPiece str,
+bool EndsWith(StringPiece str,
StringPiece search_for,
CompareCase case_sensitivity);
-BASE_EXPORT bool EndsWith(StringPiece16 str,
+bool EndsWith(StringPiece16 str,
StringPiece16 search_for,
CompareCase case_sensitivity);
@@ -346,25 +345,25 @@
// 'a' -> 10
// 'B' -> 11
// Assumes the input is a valid hex character. DCHECKs in debug builds if not.
-BASE_EXPORT char HexDigitToInt(wchar_t c);
+char HexDigitToInt(wchar_t c);
// Returns true if it's a Unicode whitespace character.
-BASE_EXPORT bool IsUnicodeWhitespace(wchar_t c);
+bool IsUnicodeWhitespace(wchar_t c);
// Return a byte string in human-readable format with a unit suffix. Not
// appropriate for use in any UI; use of FormatBytes and friends in ui/base is
// highly recommended instead. TODO(avi): Figure out how to get callers to use
// FormatBytes instead; remove this.
-BASE_EXPORT string16 FormatBytesUnlocalized(int64_t bytes);
+string16 FormatBytesUnlocalized(int64_t bytes);
// Starting at |start_offset| (usually 0), replace the first instance of
// |find_this| with |replace_with|.
-BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
+void ReplaceFirstSubstringAfterOffset(
base::string16* str,
size_t start_offset,
StringPiece16 find_this,
StringPiece16 replace_with);
-BASE_EXPORT void ReplaceFirstSubstringAfterOffset(
+void ReplaceFirstSubstringAfterOffset(
std::string* str,
size_t start_offset,
StringPiece find_this,
@@ -376,12 +375,12 @@
// This does entire substrings; use std::replace in <algorithm> for single
// characters, for example:
// std::replace(str.begin(), str.end(), 'a', 'b');
-BASE_EXPORT void ReplaceSubstringsAfterOffset(
+void ReplaceSubstringsAfterOffset(
string16* str,
size_t start_offset,
StringPiece16 find_this,
StringPiece16 replace_with);
-BASE_EXPORT void ReplaceSubstringsAfterOffset(
+void ReplaceSubstringsAfterOffset(
std::string* str,
size_t start_offset,
StringPiece find_this,
@@ -407,8 +406,8 @@
// of the string, and not doing that will mean people who access |str| rather
// than str.c_str() will get back a string of whatever size |str| had on entry
// to this function (probably 0).
-BASE_EXPORT char* WriteInto(std::string* str, size_t length_with_null);
-BASE_EXPORT char16* WriteInto(string16* str, size_t length_with_null);
+char* WriteInto(std::string* str, size_t length_with_null);
+char16* WriteInto(string16* str, size_t length_with_null);
// Does the opposite of SplitString()/SplitStringPiece(). Joins a vector or list
// of strings into a single string, inserting |separator| (which may be empty)
@@ -421,38 +420,38 @@
// copies of those strings are created until the final join operation.
//
// Use StrCat (in base/strings/strcat.h) if you don't need a separator.
-BASE_EXPORT std::string JoinString(const std::vector<std::string>& parts,
+std::string JoinString(const std::vector<std::string>& parts,
StringPiece separator);
-BASE_EXPORT string16 JoinString(const std::vector<string16>& parts,
+string16 JoinString(const std::vector<string16>& parts,
StringPiece16 separator);
-BASE_EXPORT std::string JoinString(const std::vector<StringPiece>& parts,
+std::string JoinString(const std::vector<StringPiece>& parts,
StringPiece separator);
-BASE_EXPORT string16 JoinString(const std::vector<StringPiece16>& parts,
+string16 JoinString(const std::vector<StringPiece16>& parts,
StringPiece16 separator);
// Explicit initializer_list overloads are required to break ambiguity when used
// with a literal initializer list (otherwise the compiler would not be able to
// decide between the string and StringPiece overloads).
-BASE_EXPORT std::string JoinString(std::initializer_list<StringPiece> parts,
+std::string JoinString(std::initializer_list<StringPiece> parts,
StringPiece separator);
-BASE_EXPORT string16 JoinString(std::initializer_list<StringPiece16> parts,
+string16 JoinString(std::initializer_list<StringPiece16> parts,
StringPiece16 separator);
// Replace $1-$2-$3..$9 in the format string with values from |subst|.
// Additionally, any number of consecutive '$' characters is replaced by that
// number less one. Eg $$->$, $$$->$$, etc. The offsets parameter here can be
// NULL. This only allows you to use up to nine replacements.
-BASE_EXPORT string16 ReplaceStringPlaceholders(
+string16 ReplaceStringPlaceholders(
const string16& format_string,
const std::vector<string16>& subst,
std::vector<size_t>* offsets);
-BASE_EXPORT std::string ReplaceStringPlaceholders(
+std::string ReplaceStringPlaceholders(
StringPiece format_string,
const std::vector<std::string>& subst,
std::vector<size_t>* offsets);
// Single-string shortcut for ReplaceStringHolders. |offset| may be NULL.
-BASE_EXPORT string16 ReplaceStringPlaceholders(const string16& format_string,
+string16 ReplaceStringPlaceholders(const string16& format_string,
const string16& a,
size_t* offset);
diff --git a/base/strings/stringprintf.h b/base/strings/stringprintf.h
index 83969bb..e45bef3 100644
--- a/base/strings/stringprintf.h
+++ b/base/strings/stringprintf.h
@@ -9,54 +9,53 @@
#include <string>
-#include "base/base_export.h"
#include "base/compiler_specific.h"
#include "build_config.h"
namespace base {
// Return a C++ string given printf-like input.
-BASE_EXPORT std::string StringPrintf(_Printf_format_string_ const char* format,
+std::string StringPrintf(_Printf_format_string_ const char* format,
...)
PRINTF_FORMAT(1, 2) WARN_UNUSED_RESULT;
#if defined(OS_WIN)
-BASE_EXPORT std::wstring StringPrintf(
+std::wstring StringPrintf(
_Printf_format_string_ const wchar_t* format,
...) WPRINTF_FORMAT(1, 2) WARN_UNUSED_RESULT;
#endif
// Return a C++ string given vprintf-like input.
-BASE_EXPORT std::string StringPrintV(const char* format, va_list ap)
+std::string StringPrintV(const char* format, va_list ap)
PRINTF_FORMAT(1, 0) WARN_UNUSED_RESULT;
// Store result into a supplied string and return it.
-BASE_EXPORT const std::string& SStringPrintf(
+const std::string& SStringPrintf(
std::string* dst,
_Printf_format_string_ const char* format,
...) PRINTF_FORMAT(2, 3);
#if defined(OS_WIN)
-BASE_EXPORT const std::wstring& SStringPrintf(
+const std::wstring& SStringPrintf(
std::wstring* dst,
_Printf_format_string_ const wchar_t* format,
...) WPRINTF_FORMAT(2, 3);
#endif
// Append result to a supplied string.
-BASE_EXPORT void StringAppendF(std::string* dst,
+void StringAppendF(std::string* dst,
_Printf_format_string_ const char* format,
...) PRINTF_FORMAT(2, 3);
#if defined(OS_WIN)
-BASE_EXPORT void StringAppendF(std::wstring* dst,
+void StringAppendF(std::wstring* dst,
_Printf_format_string_ const wchar_t* format,
...) WPRINTF_FORMAT(2, 3);
#endif
// Lower-level routine that takes a va_list and appends to a specified
// string. All other routines are just convenience wrappers around it.
-BASE_EXPORT void StringAppendV(std::string* dst, const char* format, va_list ap)
+void StringAppendV(std::string* dst, const char* format, va_list ap)
PRINTF_FORMAT(2, 0);
#if defined(OS_WIN)
-BASE_EXPORT void StringAppendV(std::wstring* dst,
+void StringAppendV(std::wstring* dst,
const wchar_t* format, va_list ap)
WPRINTF_FORMAT(2, 0);
#endif
diff --git a/base/strings/sys_string_conversions.h b/base/strings/sys_string_conversions.h
index 875cafb..096840b 100644
--- a/base/strings/sys_string_conversions.h
+++ b/base/strings/sys_string_conversions.h
@@ -13,7 +13,6 @@
#include <string>
-#include "base/base_export.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "build_config.h"
@@ -31,14 +30,14 @@
// Converts between wide and UTF-8 representations of a string. On error, the
// result is system-dependent.
-BASE_EXPORT std::string SysWideToUTF8(const std::wstring& wide);
-BASE_EXPORT std::wstring SysUTF8ToWide(StringPiece utf8);
+std::string SysWideToUTF8(const std::wstring& wide);
+std::wstring SysUTF8ToWide(StringPiece utf8);
// Converts between wide and the system multi-byte representations of a string.
// DANGER: This will lose information and can change (on Windows, this can
// change between reboots).
-BASE_EXPORT std::string SysWideToNativeMB(const std::wstring& wide);
-BASE_EXPORT std::wstring SysNativeMBToWide(StringPiece native_mb);
+std::string SysWideToNativeMB(const std::wstring& wide);
+std::wstring SysNativeMBToWide(StringPiece native_mb);
// Windows-specific ------------------------------------------------------------
@@ -47,8 +46,8 @@
// Converts between 8-bit and wide strings, using the given code page. The
// code page identifier is one accepted by the Windows function
// MultiByteToWideChar().
-BASE_EXPORT std::wstring SysMultiByteToWide(StringPiece mb, uint32_t code_page);
-BASE_EXPORT std::string SysWideToMultiByte(const std::wstring& wide,
+std::wstring SysMultiByteToWide(StringPiece mb, uint32_t code_page);
+std::string SysWideToMultiByte(const std::wstring& wide,
uint32_t code_page);
#endif // defined(OS_WIN)
@@ -61,21 +60,21 @@
// Creates a string, and returns it with a refcount of 1. You are responsible
// for releasing it. Returns NULL on failure.
-BASE_EXPORT CFStringRef SysUTF8ToCFStringRef(const std::string& utf8);
-BASE_EXPORT CFStringRef SysUTF16ToCFStringRef(const string16& utf16);
+CFStringRef SysUTF8ToCFStringRef(const std::string& utf8);
+CFStringRef SysUTF16ToCFStringRef(const string16& utf16);
// Same, but returns an autoreleased NSString.
-BASE_EXPORT NSString* SysUTF8ToNSString(const std::string& utf8);
-BASE_EXPORT NSString* SysUTF16ToNSString(const string16& utf16);
+NSString* SysUTF8ToNSString(const std::string& utf8);
+NSString* SysUTF16ToNSString(const string16& utf16);
// Converts a CFStringRef to an STL string. Returns an empty string on failure.
-BASE_EXPORT std::string SysCFStringRefToUTF8(CFStringRef ref);
-BASE_EXPORT string16 SysCFStringRefToUTF16(CFStringRef ref);
+std::string SysCFStringRefToUTF8(CFStringRef ref);
+string16 SysCFStringRefToUTF16(CFStringRef ref);
// Same, but accepts NSString input. Converts nil NSString* to the appropriate
// string type of length 0.
-BASE_EXPORT std::string SysNSStringToUTF8(NSString* ref);
-BASE_EXPORT string16 SysNSStringToUTF16(NSString* ref);
+std::string SysNSStringToUTF8(NSString* ref);
+string16 SysNSStringToUTF16(NSString* ref);
#endif // defined(OS_MACOSX)
diff --git a/base/strings/utf_offset_string_conversions.h b/base/strings/utf_offset_string_conversions.h
index f741955..fdd012b 100644
--- a/base/strings/utf_offset_string_conversions.h
+++ b/base/strings/utf_offset_string_conversions.h
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "base/base_export.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
@@ -20,9 +19,9 @@
// string in response to various adjustments one might do to that string
// (e.g., eliminating a range). For details on offsets, see the comments by
// the AdjustOffsets() function below.
-class BASE_EXPORT OffsetAdjuster {
+class OffsetAdjuster {
public:
- struct BASE_EXPORT Adjustment {
+ struct Adjustment {
Adjustment(size_t original_offset,
size_t original_length,
size_t output_length);
@@ -91,21 +90,21 @@
// Like the conversions in utf_string_conversions.h, but also fills in an
// |adjustments| parameter that reflects the alterations done to the string.
// It may be NULL.
-BASE_EXPORT bool UTF8ToUTF16WithAdjustments(
+bool UTF8ToUTF16WithAdjustments(
const char* src,
size_t src_len,
string16* output,
base::OffsetAdjuster::Adjustments* adjustments);
-BASE_EXPORT string16 UTF8ToUTF16WithAdjustments(
+string16 UTF8ToUTF16WithAdjustments(
const base::StringPiece& utf8,
base::OffsetAdjuster::Adjustments* adjustments);
// As above, but instead internally examines the adjustments and applies them
// to |offsets_for_adjustment|. Input offsets greater than the length of the
// input string will be set to string16::npos. See comments by AdjustOffsets().
-BASE_EXPORT string16 UTF8ToUTF16AndAdjustOffsets(
+string16 UTF8ToUTF16AndAdjustOffsets(
const base::StringPiece& utf8,
std::vector<size_t>* offsets_for_adjustment);
-BASE_EXPORT std::string UTF16ToUTF8AndAdjustOffsets(
+std::string UTF16ToUTF8AndAdjustOffsets(
const base::StringPiece16& utf16,
std::vector<size_t>* offsets_for_adjustment);
diff --git a/base/strings/utf_string_conversion_utils.h b/base/strings/utf_string_conversion_utils.h
index 2d95870..1712cee 100644
--- a/base/strings/utf_string_conversion_utils.h
+++ b/base/strings/utf_string_conversion_utils.h
@@ -11,7 +11,6 @@
#include <stddef.h>
#include <stdint.h>
-#include "base/base_export.h"
#include "base/strings/string16.h"
namespace base {
@@ -41,20 +40,20 @@
// (as in a for loop) will take the reader to the next character.
//
// Returns true on success. On false, |*code_point| will be invalid.
-BASE_EXPORT bool ReadUnicodeCharacter(const char* src,
+bool ReadUnicodeCharacter(const char* src,
int32_t src_len,
int32_t* char_index,
uint32_t* code_point_out);
// Reads a UTF-16 character. The usage is the same as the 8-bit version above.
-BASE_EXPORT bool ReadUnicodeCharacter(const char16* src,
+bool ReadUnicodeCharacter(const char16* src,
int32_t src_len,
int32_t* char_index,
uint32_t* code_point);
#if defined(WCHAR_T_IS_UTF32)
// Reads UTF-32 character. The usage is the same as the 8-bit version above.
-BASE_EXPORT bool ReadUnicodeCharacter(const wchar_t* src,
+bool ReadUnicodeCharacter(const wchar_t* src,
int32_t src_len,
int32_t* char_index,
uint32_t* code_point);
@@ -64,12 +63,12 @@
// Appends a UTF-8 character to the given 8-bit string. Returns the number of
// bytes written.
-BASE_EXPORT size_t WriteUnicodeCharacter(uint32_t code_point,
+size_t WriteUnicodeCharacter(uint32_t code_point,
std::string* output);
// Appends the given code point as a UTF-16 character to the given 16-bit
// string. Returns the number of 16-bit values written.
-BASE_EXPORT size_t WriteUnicodeCharacter(uint32_t code_point, string16* output);
+size_t WriteUnicodeCharacter(uint32_t code_point, string16* output);
#if defined(WCHAR_T_IS_UTF32)
// Appends the given UTF-32 character to the given 32-bit string. Returns the
diff --git a/base/strings/utf_string_conversions.h b/base/strings/utf_string_conversions.h
index 14f94ac..45a4be3 100644
--- a/base/strings/utf_string_conversions.h
+++ b/base/strings/utf_string_conversions.h
@@ -9,7 +9,6 @@
#include <string>
-#include "base/base_export.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
@@ -21,33 +20,33 @@
// do the best it can and put the result in the output buffer. The versions that
// return strings ignore this error and just return the best conversion
// possible.
-BASE_EXPORT bool WideToUTF8(const wchar_t* src, size_t src_len,
+bool WideToUTF8(const wchar_t* src, size_t src_len,
std::string* output);
-BASE_EXPORT std::string WideToUTF8(WStringPiece wide);
-BASE_EXPORT bool UTF8ToWide(const char* src, size_t src_len,
+std::string WideToUTF8(WStringPiece wide);
+bool UTF8ToWide(const char* src, size_t src_len,
std::wstring* output);
-BASE_EXPORT std::wstring UTF8ToWide(StringPiece utf8);
+std::wstring UTF8ToWide(StringPiece utf8);
-BASE_EXPORT bool WideToUTF16(const wchar_t* src, size_t src_len,
+bool WideToUTF16(const wchar_t* src, size_t src_len,
string16* output);
-BASE_EXPORT string16 WideToUTF16(WStringPiece wide);
-BASE_EXPORT bool UTF16ToWide(const char16* src, size_t src_len,
+string16 WideToUTF16(WStringPiece wide);
+bool UTF16ToWide(const char16* src, size_t src_len,
std::wstring* output);
-BASE_EXPORT std::wstring UTF16ToWide(StringPiece16 utf16);
+std::wstring UTF16ToWide(StringPiece16 utf16);
-BASE_EXPORT bool UTF8ToUTF16(const char* src, size_t src_len, string16* output);
-BASE_EXPORT string16 UTF8ToUTF16(StringPiece utf8);
-BASE_EXPORT bool UTF16ToUTF8(const char16* src, size_t src_len,
+bool UTF8ToUTF16(const char* src, size_t src_len, string16* output);
+string16 UTF8ToUTF16(StringPiece utf8);
+bool UTF16ToUTF8(const char16* src, size_t src_len,
std::string* output);
-BASE_EXPORT std::string UTF16ToUTF8(StringPiece16 utf16);
+std::string UTF16ToUTF8(StringPiece16 utf16);
// This converts an ASCII string, typically a hardcoded constant, to a UTF16
// string.
-BASE_EXPORT string16 ASCIIToUTF16(StringPiece ascii);
+string16 ASCIIToUTF16(StringPiece ascii);
// Converts to 7-bit ASCII by truncating. The result must be known to be ASCII
// beforehand.
-BASE_EXPORT std::string UTF16ToASCII(StringPiece16 utf16);
+std::string UTF16ToASCII(StringPiece16 utf16);
} // namespace base