Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * Copyright (C) 2014 HUBzero Foundation, LLC |
---|
4 | * |
---|
5 | * Author: Leif Delgass <ldelgass@purdue.edu> |
---|
6 | */ |
---|
7 | #ifndef GEOVIS_FILEUTIL_H |
---|
8 | #define GEOVIS_FILEUTIL_H |
---|
9 | |
---|
10 | #include <osgEarth/FileUtils> |
---|
11 | |
---|
12 | namespace GeoVis { |
---|
13 | |
---|
14 | class DirectoryVisitor : public osgEarth::DirectoryVisitor |
---|
15 | { |
---|
16 | public: |
---|
17 | DirectoryVisitor() |
---|
18 | {} |
---|
19 | |
---|
20 | virtual void handlePostDir(const std::string& path) |
---|
21 | {} |
---|
22 | |
---|
23 | virtual void traverse(const std::string& path); |
---|
24 | }; |
---|
25 | |
---|
26 | class CollectFilesVisitor : public DirectoryVisitor |
---|
27 | { |
---|
28 | public: |
---|
29 | CollectFilesVisitor() |
---|
30 | {} |
---|
31 | |
---|
32 | virtual void handleFile(const std::string& path) |
---|
33 | { |
---|
34 | filenames.push_back(path); |
---|
35 | } |
---|
36 | |
---|
37 | virtual void handlePostDir(const std::string& path) |
---|
38 | { |
---|
39 | dirnames.push_back(path); |
---|
40 | } |
---|
41 | |
---|
42 | std::vector<std::string> filenames; |
---|
43 | std::vector<std::string> dirnames; |
---|
44 | }; |
---|
45 | |
---|
46 | extern void removeDirectory(const char *path); |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.