PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
PathTest.cpp
Go to the documentation of this file.
1//* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
3// Name: PathTest.cpp
4// Purpose: Tests the PEBLPath Class
5// Author: Shane T. Mueller, Ph.D.
6// Copyright: (c) 2003 Shane T. Mueller <smueller@umich.edu>
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#include "../utility/PEBLPath.h"
28#include "../base/Evaluator.h"
29#include "../devices/PEventLoop.h"
30#include <iostream>
31
32using std::cout;
33using std::endl;
34using std::flush;
35
36
37
38
39//The following is the entry point for the command-line version
40int main(int argc, char **argv)
41{
42
43
44
45 cout << "\n\n\n==========================================================\n";
46 cout << "Testing the PEBLPath Class\n";
47 cout << "==========================================================\n";
48
49 PEBLPath myPath(argv[0]);
50
51 cout << "==========================================================\n";
52 cout << "Adding directories to path\n";
53 cout << "==========================================================\n";
54 // myPath.AddToPathList("./");
55 // myPath.AddToPathList("media/");
56 // myPath.AddToPathList("media/fonts/");
57
58
59 cout << "Looking for file Vera.ttf: [" << myPath.FindFile("Vera.ttf") << "]\n";
60 cout << "Looking for file Uppercase.txt:[" << myPath.FindFile("Uppercase.txt") << "]\n";
61
62
63 cout << "Looking for file Makefile: [" << myPath.FindFile("Makefile") << "]\n";
64 cout << "Looking for file notafile.txt: [" << myPath.FindFile("notafile.txt") << "]\n";
65
66 cout << "Finished" << endl;
67 return 0;
68}
69
int main(int argc, char **argv)
Definition PathTest.cpp:40
std::string FindFile(const string &filename)
Definition PEBLPath.cpp:368