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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/sync/util/character_set_converters.h"
6
7 #include <string>
8
9 using std::string;
10
11 namespace browser_sync {
12
13 void PathStringToUTF8(const PathChar* wide, int size,
14 std::string* output_string) {
15 CHECK(output_string);
16 output_string->clear();
17 AppendPathStringToUTF8(wide, size, output_string);
18 }
19
20 bool UTF8ToPathString(const char* utf8, size_t size,
21 PathString* output_string) {
22 CHECK(output_string);
23 output_string->clear();
24 return AppendUTF8ToPathString(utf8, size, output_string);
25 };
26
27 ToUTF8::ToUTF8(const PathChar* wide, size_t size) {
28 PathStringToUTF8(wide, size, &result_);
29 }
30
31 ToUTF8::ToUTF8(const PathString& wide) {
32 PathStringToUTF8(wide.data(), wide.length(), &result_);
33 }
34
35 ToUTF8::ToUTF8(const PathChar* wide) {
36 PathStringToUTF8(wide, PathLen(wide), &result_);
37 }
38
39 ToPathString::ToPathString(const char* utf8, size_t size) {
40 good_ = UTF8ToPathString(utf8, size, &result_);
41 good_checked_ = false;
42 }
43
44 ToPathString::ToPathString(const std::string& utf8) {
45 good_ = UTF8ToPathString(utf8.data(), utf8.length(), &result_);
46 good_checked_ = false;
47 }
48
49 ToPathString::ToPathString(const char* utf8) {
50 good_ = UTF8ToPathString(utf8, strlen(utf8), &result_);
51 good_checked_ = false;
52 }
53
54 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698