Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

dtool/src/dconfig/test_searchpath.cxx

Go to the documentation of this file.
00001 // Filename: test_searchpath.cxx
00002 // Created by:  cary (01Sep98)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include <dSearchPath.h>
00020 //#include <expand.h>
00021 #include <string>
00022 
00023 void TestSearch()
00024 {
00025    std::string line, path;
00026 
00027 //   path = ".:~ /etc";
00028    path = ". /etc";
00029 //   path = Expand::Expand(path);
00030    line = "searchpath.h";
00031    cout << "looking for file '" << line << "' in path '" << path << "': '";
00032    line = DSearchPath::search_path(line, path);
00033    cout << line << "'" << endl;
00034 
00035    line = ".cshrc";
00036    cout << "looking for file '" << line << "' in path '" << path << "': '";
00037    line = DSearchPath::search_path(line, path);
00038    cout << line << "'" << endl;
00039 
00040    line = "passwd";
00041    cout << "looking for file '" << line << "' in path '" << path << "': '";
00042    line = DSearchPath::search_path(line, path);
00043    cout << line << "'" << endl;
00044 }
00045 
00046 main()
00047 {
00048    cout << "Testing search path:" << endl;
00049    TestSearch();
00050 }

Generated on Thu May 1 22:12:58 2003 for DTool by doxygen1.3