2011-10-05 05:20:07 +00:00
|
|
|
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef BIN_DIRECTORY_H_
|
|
|
|
#define BIN_DIRECTORY_H_
|
|
|
|
|
|
|
|
#include "bin/builtin.h"
|
|
|
|
#include "bin/globals.h"
|
|
|
|
|
|
|
|
class Directory {
|
|
|
|
public:
|
2011-10-14 12:42:44 +00:00
|
|
|
enum ExistsResult {
|
|
|
|
UNKNOWN,
|
|
|
|
EXISTS,
|
|
|
|
DOES_NOT_EXIST
|
|
|
|
};
|
|
|
|
|
2011-10-05 14:33:49 +00:00
|
|
|
static void List(const char* path,
|
2011-10-05 05:20:07 +00:00
|
|
|
bool recursive,
|
2011-10-12 10:39:30 +00:00
|
|
|
Dart_Port dir_port,
|
|
|
|
Dart_Port file_port,
|
|
|
|
Dart_Port done_port,
|
|
|
|
Dart_Port error_port);
|
2011-10-05 05:20:07 +00:00
|
|
|
|
2011-10-14 12:42:44 +00:00
|
|
|
static ExistsResult Exists(const char* path);
|
|
|
|
|
|
|
|
static bool Create(const char* path);
|
|
|
|
|
2011-12-13 14:22:50 +00:00
|
|
|
static int CreateTemp(const char* const_template,
|
|
|
|
char** path,
|
|
|
|
char* os_error_message,
|
|
|
|
int os_error_message_len);
|
2011-11-22 13:06:39 +00:00
|
|
|
|
2011-10-14 12:42:44 +00:00
|
|
|
static bool Delete(const char* path);
|
|
|
|
|
2011-10-05 05:20:07 +00:00
|
|
|
DISALLOW_ALLOCATION();
|
|
|
|
DISALLOW_IMPLICIT_CONSTRUCTORS(Directory);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BIN_DIRECTORY_H_
|