PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PEBLPath.h
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: src/utility/PEBLPath.h
4// Purpose: Utility class storing search path and searching for files there
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003-2026 Shane T. Mueller <smueller@obereed.net>
7// License: GPL 2
8//
9//
10//
11// This file is part of the PEBL project.
12//
13// PEBL is free software; you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation; either version 2 of the License, or
16// (at your option) any later version.
17//
18// PEBL is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with PEBL; if not, write to the Free Software
25// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27#ifndef __PEBLPATH_H__
28#define __PEBLPATH_H__
29
30#include <list>
31#include <string>
32using std::string;
33
34class Variant;
35
40
42{
43public:
44
45 PEBLPath();
46 ~PEBLPath();
47
48 //This sets up default pathnames. Called by const char constructor; takes the
49 //binary filename and uses it on platforms where this indicates location of
50 //support files.
51 void Initialize(std::list<std::string>);
52
53
54 void AddToPathList(const string & s);
55 std::string FindFile(const string & filename);
56
57 const string MergePathAndFile(const string & path, const string & file);
58 bool IsDirectory(const string & pathname);
59
60
61 friend std::ostream & operator << (std::ostream & out, const PEBLPath & path);
62 std::ostream & Print(std::ostream & out) const;
63private:
64
67 std::list<string> mPathList;
68
69
70};
71
72#endif
const string MergePathAndFile(const string &path, const string &file)
Definition PEBLPath.cpp:405
std::string FindFile(const string &filename)
Definition PEBLPath.cpp:368
void AddToPathList(const string &s)
Definition PEBLPath.cpp:361
std::ostream & Print(std::ostream &out) const
Definition PEBLPath.cpp:434
friend std::ostream & operator<<(std::ostream &out, const PEBLPath &path)
void Initialize(std::list< std::string >)
Definition PEBLPath.cpp:60
bool IsDirectory(const string &pathname)
Definition PEBLPath.cpp:411