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

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

Issue 8439067: Implement fullPath method on File objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "bin/file.h" 5 #include "bin/file.h"
6 6
7 #include "bin/builtin.h" 7 #include "bin/builtin.h"
8 #include "bin/dartutils.h" 8 #include "bin/dartutils.h"
9 9
10 #include "include/dart_api.h" 10 #include "include/dart_api.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 245
246 246
247 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) { 247 void FUNCTION_NAME(File_Create)(Dart_NativeArguments args) {
248 Dart_EnterScope(); 248 Dart_EnterScope();
249 const char* str = 249 const char* str =
250 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); 250 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
251 bool result = File::Create(str); 251 bool result = File::Create(str);
252 Dart_SetReturnValue(args, Dart_NewBoolean(result)); 252 Dart_SetReturnValue(args, Dart_NewBoolean(result));
253 Dart_ExitScope(); 253 Dart_ExitScope();
254 } 254 }
255
256
257 void FUNCTION_NAME(File_FullPath)(Dart_NativeArguments args) {
258 Dart_EnterScope();
259 const char* str =
260 DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
261 char* path = File::GetCanonicalPath(str);
262 if (path != NULL) {
263 Dart_SetReturnValue(args, Dart_NewString(path));
264 free(path);
265 }
266 Dart_ExitScope();
267 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698