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

Side by Side Diff: runtime/bin/utils_linux.cc

Issue 1194883002: Improve the encoding/decoding to/from system encoding on Windows (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Addressed review comments from lrn@ Created 5 years, 5 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
« no previous file with comments | « runtime/bin/utils_android.cc ('k') | runtime/bin/utils_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include <errno.h> // NOLINT 8 #include <errno.h> // NOLINT
9 #include <netdb.h> // NOLINT 9 #include <netdb.h> // NOLINT
10 #include <sys/time.h> // NOLINT 10 #include <sys/time.h> // NOLINT
(...skipping 22 matching lines...) Expand all
33 const int kBufferSize = 1024; 33 const int kBufferSize = 1024;
34 char error_buf[kBufferSize]; 34 char error_buf[kBufferSize];
35 SetMessage(strerror_r(code, error_buf, kBufferSize)); 35 SetMessage(strerror_r(code, error_buf, kBufferSize));
36 } else if (sub_system == kGetAddressInfo) { 36 } else if (sub_system == kGetAddressInfo) {
37 SetMessage(gai_strerror(code)); 37 SetMessage(gai_strerror(code));
38 } else { 38 } else {
39 UNREACHABLE(); 39 UNREACHABLE();
40 } 40 }
41 } 41 }
42 42
43 const char* StringUtils::ConsoleStringToUtf8(const char* str) { 43 const char* StringUtils::ConsoleStringToUtf8(
44 return str; 44 const char* str, intptr_t len, intptr_t* result_len) {
45 }
46
47 const char* StringUtils::Utf8ToConsoleString(const char* utf8) {
48 return utf8;
49 }
50
51 char* StringUtils::ConsoleStringToUtf8(char* str) {
52 return str;
53 }
54
55 char* StringUtils::Utf8ToConsoleString(char* utf8) {
56 return utf8;
57 }
58
59 wchar_t* StringUtils::Utf8ToWide(char* utf8) {
60 UNIMPLEMENTED(); 45 UNIMPLEMENTED();
61 return NULL; 46 return NULL;
62 } 47 }
63 48
64 const wchar_t* StringUtils::Utf8ToWide(const char* utf8) { 49 const char* StringUtils::Utf8ToConsoleString(
50 const char* utf8, intptr_t len, intptr_t* result_len) {
65 UNIMPLEMENTED(); 51 UNIMPLEMENTED();
66 return NULL; 52 return NULL;
67 } 53 }
68 54
69 char* StringUtils::WideToUtf8(wchar_t* str) { 55 char* StringUtils::ConsoleStringToUtf8(
56 char* str, intptr_t len, intptr_t* result_len) {
70 UNIMPLEMENTED(); 57 UNIMPLEMENTED();
71 return NULL; 58 return NULL;
72 } 59 }
73 60
74 const char* StringUtils::WideToUtf8(const wchar_t* str) { 61 char* StringUtils::Utf8ToConsoleString(
62 char* utf8, intptr_t len, intptr_t* result_len) {
75 UNIMPLEMENTED(); 63 UNIMPLEMENTED();
76 return NULL; 64 return NULL;
77 } 65 }
78 66
79 wchar_t** ShellUtils::GetUnicodeArgv(int* argc) { 67 bool ShellUtils::GetUtf8Argv(int argc, char** argv) {
80 return NULL; 68 return false;
81 }
82
83 void ShellUtils::FreeUnicodeArgv(wchar_t** argv) {
84 } 69 }
85 70
86 int64_t TimerUtils::GetCurrentTimeMilliseconds() { 71 int64_t TimerUtils::GetCurrentTimeMilliseconds() {
87 return GetCurrentTimeMicros() / 1000; 72 return GetCurrentTimeMicros() / 1000;
88 } 73 }
89 74
90 int64_t TimerUtils::GetCurrentTimeMicros() { 75 int64_t TimerUtils::GetCurrentTimeMicros() {
91 struct timeval tv; 76 struct timeval tv;
92 if (gettimeofday(&tv, NULL) < 0) { 77 if (gettimeofday(&tv, NULL) < 0) {
93 UNREACHABLE(); 78 UNREACHABLE();
(...skipping 20 matching lines...) Expand all
114 ASSERT(errno == EINTR); 99 ASSERT(errno == EINTR);
115 // Copy remainder into requested and repeat. 100 // Copy remainder into requested and repeat.
116 req = rem; 101 req = rem;
117 } 102 }
118 } 103 }
119 104
120 } // namespace bin 105 } // namespace bin
121 } // namespace dart 106 } // namespace dart
122 107
123 #endif // defined(TARGET_OS_LINUX) 108 #endif // defined(TARGET_OS_LINUX)
OLDNEW
« no previous file with comments | « runtime/bin/utils_android.cc ('k') | runtime/bin/utils_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698