Last change
on this file since 6666 was
6382,
checked in by ldelgass, 8 years ago
|
Use hub url if supplied to get idata URL
|
-
Property svn:eol-style set to
native
|
File size:
1.6 KB
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (C) 2015 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | * Author: Leif Delgass <ldelgass@purdue.edu> |
---|
6 | */ |
---|
7 | #ifndef GEOVIS_IDATA_H |
---|
8 | #define GEOVIS_IDATA_H |
---|
9 | |
---|
10 | #include <vector> |
---|
11 | #include <string> |
---|
12 | |
---|
13 | namespace IData { |
---|
14 | |
---|
15 | enum Command { |
---|
16 | COMMAND_LIST, |
---|
17 | COMMAND_GET, |
---|
18 | COMMAND_CONTENTS, |
---|
19 | COMMAND_SETGLOBALMETA, |
---|
20 | COMMAND_DELETE, |
---|
21 | COMMAND_UPLOAD, |
---|
22 | COMMAND_FINISHUPLOAD, |
---|
23 | COMMAND_CHECKSUM |
---|
24 | }; |
---|
25 | |
---|
26 | /// For "shared" property of Collection |
---|
27 | enum Shared { |
---|
28 | NOT_SHARED, |
---|
29 | READ_ONLY, |
---|
30 | READ_WRITE |
---|
31 | }; |
---|
32 | |
---|
33 | /// For "dir-or-file" property of DirectoryItem |
---|
34 | enum DirectoryItemType { |
---|
35 | TYPE_DIRECTORY = 1, |
---|
36 | TYPE_FILE = 2 |
---|
37 | }; |
---|
38 | |
---|
39 | class Collection { |
---|
40 | public: |
---|
41 | std::string name; |
---|
42 | std::string shared; // "no", "read-only","read-write" |
---|
43 | unsigned int id; |
---|
44 | }; |
---|
45 | |
---|
46 | class DirectoryItem { |
---|
47 | public: |
---|
48 | DirectoryItem() : |
---|
49 | size(0) |
---|
50 | {} |
---|
51 | std::string name; |
---|
52 | bool isDir; |
---|
53 | std::string type; |
---|
54 | size_t size; |
---|
55 | std::string ctime; |
---|
56 | std::string doi; |
---|
57 | }; |
---|
58 | |
---|
59 | class Buffer { |
---|
60 | public: |
---|
61 | Buffer() : |
---|
62 | data(0), size(0) |
---|
63 | {} |
---|
64 | ~Buffer() { free(data); } |
---|
65 | void *data; |
---|
66 | size_t size; |
---|
67 | }; |
---|
68 | |
---|
69 | extern void iDataInit(const char *username, const char *hubURL = NULL); |
---|
70 | extern void iDataCleanup(); |
---|
71 | extern void getCollectionList(std::vector<Collection>& list); |
---|
72 | extern void getContents(int collectionID, const char *path, std::vector<DirectoryItem>& contents); |
---|
73 | extern void getFile(int collectionID, const char *doi, Buffer *buff); |
---|
74 | extern void deleteFile(int collectionID, const char *path, const char *filename); |
---|
75 | extern void setFileMetadata(int collectionID, const char *doi, const char *name, const char *value); |
---|
76 | |
---|
77 | } |
---|
78 | |
---|
79 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.