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

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

Issue 3001963002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Fuchsia fix Created 3 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
« no previous file with comments | « runtime/bin/namespace_unsupported.cc ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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, const char* path,
49 intptr_t* dirfd, const char** resolved_path) {
50 UNIMPLEMENTED();
51 return false;
52 }
53
54 NamespaceScope::NamespaceScope(Namespace* namespc, const char* path) {
55 UNIMPLEMENTED();
56 }
57
58 NamespaceScope::~NamespaceScope() {
59 UNIMPLEMENTED();
60 }
61
62 } // namespace bin
63 } // namespace dart
64
65 #endif // defined(HOST_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/bin/namespace_unsupported.cc ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698