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

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

Issue 194065: Initial commit of sync engine code to browser/sync.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixes to gtest include path, reverted syncapi. Created 11 years, 3 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.cc
===================================================================
--- chrome/browser/sync/util/character_set_converters.cc (revision 0)
+++ chrome/browser/sync/util/character_set_converters.cc (revision 0)
@@ -0,0 +1,54 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/sync/util/character_set_converters.h"
+
+#include <string>
+
+using std::string;
+
+namespace browser_sync {
+
+void PathStringToUTF8(const PathChar* wide, int size,
+ std::string* output_string) {
+ CHECK(output_string);
+ output_string->clear();
+ AppendPathStringToUTF8(wide, size, output_string);
+}
+
+bool UTF8ToPathString(const char* utf8, size_t size,
+ PathString* output_string) {
+ CHECK(output_string);
+ output_string->clear();
+ return AppendUTF8ToPathString(utf8, size, output_string);
+};
+
+ToUTF8::ToUTF8(const PathChar* wide, size_t size) {
+ PathStringToUTF8(wide, size, &result_);
+}
+
+ToUTF8::ToUTF8(const PathString& wide) {
+ PathStringToUTF8(wide.data(), wide.length(), &result_);
+}
+
+ToUTF8::ToUTF8(const PathChar* wide) {
+ PathStringToUTF8(wide, PathLen(wide), &result_);
+}
+
+ToPathString::ToPathString(const char* utf8, size_t size) {
+ good_ = UTF8ToPathString(utf8, size, &result_);
+ good_checked_ = false;
+}
+
+ToPathString::ToPathString(const std::string& utf8) {
+ good_ = UTF8ToPathString(utf8.data(), utf8.length(), &result_);
+ good_checked_ = false;
+}
+
+ToPathString::ToPathString(const char* utf8) {
+ good_ = UTF8ToPathString(utf8, strlen(utf8), &result_);
+ good_checked_ = false;
+}
+
+} // namespace browser_sync
Property changes on: chrome\browser\sync\util\character_set_converters.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698