OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 4 |
| 5 #include "platform/globals.h" |
| 6 #if defined(HOST_OS_WINDOWS) |
| 7 |
| 8 #include "bin/namespace.h" |
| 9 |
| 10 #include <errno.h> |
| 11 #include <sys/stat.h> |
| 12 |
| 13 #include "bin/utils.h" |
| 14 #include "bin/utils_win.h" |
| 15 |
| 16 namespace dart { |
| 17 namespace bin { |
| 18 |
| 19 Namespace* Namespace::Create(const char* path) { |
| 20 UNIMPLEMENTED(); |
| 21 return NULL; |
| 22 } |
| 23 |
| 24 Namespace::~Namespace() {} |
| 25 |
| 26 intptr_t Namespace::Default() { |
| 27 return kNone; |
| 28 } |
| 29 |
| 30 const char* Namespace::GetCurrent(Namespace* namespc) { |
| 31 int length = GetCurrentDirectoryW(0, NULL); |
| 32 if (length == 0) { |
| 33 return NULL; |
| 34 } |
| 35 wchar_t* current; |
| 36 current = reinterpret_cast<wchar_t*>( |
| 37 Dart_ScopeAllocate((length + 1) * sizeof(*current))); |
| 38 GetCurrentDirectoryW(length + 1, current); |
| 39 return StringUtilsWin::WideToUtf8(current); |
| 40 } |
| 41 |
| 42 bool Namespace::SetCurrent(Namespace* namespc, const char* path) { |
| 43 Utf8ToWideScope system_path(path); |
| 44 bool result = SetCurrentDirectoryW(system_path.wide()) != 0; |
| 45 return result; |
| 46 } |
| 47 |
| 48 bool Namespace::ResolvePath(Namespace* namespc, |
| 49 const char* path, |
| 50 intptr_t* dirfd, |
| 51 const char** resolved_path) { |
| 52 UNIMPLEMENTED(); |
| 53 return false; |
| 54 } |
| 55 |
| 56 NamespaceScope::NamespaceScope(Namespace* namespc, const char* path) { |
| 57 UNIMPLEMENTED(); |
| 58 } |
| 59 |
| 60 NamespaceScope::~NamespaceScope() { |
| 61 UNIMPLEMENTED(); |
| 62 } |
| 63 |
| 64 } // namespace bin |
| 65 } // namespace dart |
| 66 |
| 67 #endif // defined(HOST_OS_WINDOWS) |
OLD | NEW |