| Index: native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs_node.h
|
| diff --git a/native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs_node.h b/native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs_node.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..82f7416a8d160a0bea63b02ebd364d57db328375
|
| --- /dev/null
|
| +++ b/native_client_sdk/src/libraries/nacl_io/googledrivefs/googledrivefs_node.h
|
| @@ -0,0 +1,59 @@
|
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef LIBRARIES_NACL_IO_GOOGLEDRIVEFS_NODE_H_
|
| +#define LIBRARIES_NACL_IO_GOOGLEDRIVEFS_NODE_H_
|
| +
|
| +#include <time.h>
|
| +#include <vector>
|
| +
|
| +#include "nacl_io/error.h"
|
| +
|
| +#include "nacl_io/filesystem.h"
|
| +#include "nacl_io/kernel_handle.h"
|
| +#include "nacl_io/path.h"
|
| +
|
| +namespace nacl_io {
|
| +
|
| +class GoogleDriveFsNode : public Node {
|
| + public:
|
| + GoogleDriveFsNode(Filesystem* filesystem, Path path);
|
| +
|
| + Error GetDents(size_t offs, struct dirent* pdir, size_t size, int* out_bytes);
|
| + Error Write(const HandleAttr& attr,
|
| + const void* buf,
|
| + size_t count,
|
| + int* out_bytes);
|
| + Error FTruncate(off_t length);
|
| + Error Read(const HandleAttr& attr, void* buf, size_t count, int* out_bytes);
|
| + Error GetSize(off_t* out_size);
|
| + Error GetStat(struct stat* pstat);
|
| + Error Init(int open_flags);
|
| + void Destroy();
|
| +
|
| + private:
|
| + Error ReadHelper(off_t start,
|
| + off_t end,
|
| + std::string* out_string_buffer,
|
| + int* out_bytes);
|
| + Error WriteHelper(const char* body_data, uint32_t body_size);
|
| + Error GetModifiedTime(time_t* out_mtime);
|
| + Error CreateEmptyFile();
|
| + Error RequestDirentHelper(const std::string& url,
|
| + std::vector<std::string>* out_dirent_names);
|
| + Error RequestDirentWithNextPageToken(
|
| + const std::string& next_page_token,
|
| + std::vector<std::string>* out_dirent_names);
|
| + Error RequestDirent(std::vector<std::string>* out_dirent_names);
|
| +
|
| + std::string parent_dir_id_;
|
| + std::string item_id_;
|
| + Path path_;
|
| +
|
| + friend class GoogleDriveFs;
|
| +};
|
| +
|
| +} // namespace nacl_io
|
| +
|
| +#endif // LIBRARIES_NACL_IO_GOOGLEDRIVEFS_NODE_H_
|
|
|