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

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

Issue 3007703002: [dart:io] Namespaces for file IO (Closed)
Patch Set: Remove namespace_unsupported.cc 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_patch.dart ('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,
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)
OLDNEW
« no previous file with comments | « runtime/bin/namespace_patch.dart ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698