source: geovis/branches/1.0/FileUtil.h @ 6666

Last change on this file since 6666 was 5895, checked in by ldelgass, 9 years ago

Initial support for parsing protocols in url strings: "local://" for files
transferred from client to cache dir, "file://" for server paths (default for
when no protocol is present), and "idata://" for idata collection/doi.

File size: 1007 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 <string>
11
12#include <osgEarth/FileUtils>
13
14namespace GeoVis {
15
16class DirectoryVisitor : public osgEarth::DirectoryVisitor
17{
18public:
19    DirectoryVisitor()
20    {}
21
22    virtual void handlePostDir(const std::string& path)
23    {}
24
25    virtual void traverse(const std::string& path);
26};
27
28class CollectFilesVisitor : public DirectoryVisitor
29{
30public:
31    CollectFilesVisitor()
32    {}
33
34    virtual void handleFile(const std::string& path)
35    {
36        filenames.push_back(path);
37    }
38
39    virtual void handlePostDir(const std::string& path)
40    {
41        dirnames.push_back(path);
42    }
43
44    std::vector<std::string> filenames;
45    std::vector<std::string> dirnames;
46};
47
48extern void removeDirectory(const char *path);
49std::string getLocalFilePath(const std::string& url);
50
51}
52
53#endif
Note: See TracBrowser for help on using the repository browser.