source: geovis/trunk/FileUtil.h @ 5852

Last change on this file since 5852 was 4376, checked in by ldelgass, 10 years ago

Add file utilities class

File size: 934 bytes
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
12namespace GeoVis {
13
14class DirectoryVisitor : public osgEarth::DirectoryVisitor
15{
16public:
17    DirectoryVisitor()
18    {}
19
20    virtual void handlePostDir(const std::string& path)
21    {}
22
23    virtual void traverse(const std::string& path);
24};
25
26class CollectFilesVisitor : public DirectoryVisitor
27{
28public:
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
46extern void removeDirectory(const char *path);
47
48}
49
50#endif
Note: See TracBrowser for help on using the repository browser.