| OLD | NEW |
| 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 #ifndef BIN_UTILS_H_ | 5 #ifndef BIN_UTILS_H_ |
| 6 #define BIN_UTILS_H_ | 6 #define BIN_UTILS_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 intptr_t* result_len = NULL); | 76 intptr_t* result_len = NULL); |
| 77 static char* ConsoleStringToUtf8(char* str, | 77 static char* ConsoleStringToUtf8(char* str, |
| 78 intptr_t len = -1, | 78 intptr_t len = -1, |
| 79 intptr_t* result_len = NULL); | 79 intptr_t* result_len = NULL); |
| 80 static const char* Utf8ToConsoleString(const char* utf8, | 80 static const char* Utf8ToConsoleString(const char* utf8, |
| 81 intptr_t len = -1, | 81 intptr_t len = -1, |
| 82 intptr_t* result_len = NULL); | 82 intptr_t* result_len = NULL); |
| 83 static char* Utf8ToConsoleString(char* utf8, | 83 static char* Utf8ToConsoleString(char* utf8, |
| 84 intptr_t len = -1, | 84 intptr_t len = -1, |
| 85 intptr_t* result_len = NULL); | 85 intptr_t* result_len = NULL); |
| 86 |
| 87 private: |
| 88 DISALLOW_ALLOCATION(); |
| 89 DISALLOW_IMPLICIT_CONSTRUCTORS(StringUtils); |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 | 92 |
| 89 class ShellUtils { | 93 class ShellUtils { |
| 90 public: | 94 public: |
| 91 // Convert all the arguments to UTF8. On Windows, the arguments are | 95 // Convert all the arguments to UTF8. On Windows, the arguments are |
| 92 // encoded in the current code page and not UTF8. | 96 // encoded in the current code page and not UTF8. |
| 93 // | 97 // |
| 94 // Returns true if the arguments are converted. In that case | 98 // Returns true if the arguments are converted. In that case |
| 95 // each of the arguments need to be deallocated using free. | 99 // each of the arguments need to be deallocated using free. |
| 96 static bool GetUtf8Argv(int argc, char** argv); | 100 static bool GetUtf8Argv(int argc, char** argv); |
| 101 |
| 102 private: |
| 103 DISALLOW_ALLOCATION(); |
| 104 DISALLOW_IMPLICIT_CONSTRUCTORS(ShellUtils); |
| 97 }; | 105 }; |
| 98 | 106 |
| 107 |
| 99 class TimerUtils { | 108 class TimerUtils { |
| 100 public: | 109 public: |
| 101 static void InitOnce(); | 110 static void InitOnce(); |
| 102 static int64_t GetCurrentMonotonicMicros(); | 111 static int64_t GetCurrentMonotonicMicros(); |
| 103 static int64_t GetCurrentMonotonicMillis(); | 112 static int64_t GetCurrentMonotonicMillis(); |
| 104 static void Sleep(int64_t millis); | 113 static void Sleep(int64_t millis); |
| 114 |
| 115 private: |
| 116 DISALLOW_ALLOCATION(); |
| 117 DISALLOW_IMPLICIT_CONSTRUCTORS(TimerUtils); |
| 105 }; | 118 }; |
| 106 | 119 |
| 107 } // namespace bin | 120 } // namespace bin |
| 108 } // namespace dart | 121 } // namespace dart |
| 109 | 122 |
| 110 #endif // BIN_UTILS_H_ | 123 #endif // BIN_UTILS_H_ |
| OLD | NEW |