Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1723)

Unified Diff: chrome/browser/sync/util/character_set_converters.h

Issue 279004: Made sync code build and pass unit tests on OS X. (Closed)
Patch Set: Fixed uninitialized var error. Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/util/character_set_converters.h
diff --git a/chrome/browser/sync/util/character_set_converters.h b/chrome/browser/sync/util/character_set_converters.h
index 1db32c7904b68625df9529b269fb6bb6dadbceca..6a833ee98a3335ec6c68ff81ea78bb291787e286 100644
--- a/chrome/browser/sync/util/character_set_converters.h
+++ b/chrome/browser/sync/util/character_set_converters.h
@@ -136,6 +136,21 @@ inline void AppendPathStringToUTF8(const PathString& wide,
return AppendPathStringToUTF8(wide.data(), wide.length(), output_string);
}
+// Versions of UTF8ToPathString/PathStringToUTF8 that return the converted
+// string directly. Any errors encountered will CHECK(). These functions are
+// intended to be used only for testing.
+
+inline PathString UTF8ToPathStringQuick(const std::string &utf8) {
+ PathString wide;
+ CHECK(UTF8ToPathString(utf8.data(), utf8.size(), &wide));
+ return wide;
+}
+
+inline std::string PathStringToUTF8Quick(const PathString& wide) {
+ std::string utf8;
+ PathStringToUTF8(wide.data(), wide.size(), &utf8);
+ return utf8;
+}
inline bool Append(const PathChar* wide, int size,
std::string* output_string) {

Powered by Google App Engine
This is Rietveld 408576698