VTK
vtkPSystemTools.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPSystemTools.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14 =========================================================================*/
29#ifndef vtkPSystemTools_h
30#define vtkPSystemTools_h
31
32#include "vtkParallelCoreModule.h" // For export macro
33#include "vtkObject.h"
34#include <string> // for string functions in SystemTools
35
36class VTKPARALLELCORE_EXPORT vtkPSystemTools : public vtkObject
37{
38 public:
41 void PrintSelf(ostream& os, vtkIndent indent);
42
49 static void BroadcastString(std::string&, int proc);
50
58 static std::string CollapseFullPath(const std::string& in_relative);
59 static std::string CollapseFullPath(const std::string& in_relative,
60 const char* in_base);
61
63
71 static bool FileExists(const char* filename, bool isFile);
72 static bool FileExists(const std::string& filename, bool isFile);
73 static bool FileExists(const char* filename);
74 static bool FileExists(const std::string& filename);
76
80 static bool FileIsDirectory(const std::string& name);
81
94 static bool FindProgramPath(const char* argv0,
95 std::string& pathOut,
96 std::string& errorMsg,
97 const char* exeName = 0,
98 const char* buildDir = 0,
99 const char* installPrefix = 0);
100
104 static std::string GetCurrentWorkingDirectory(bool collapse =true);
105
112
113protected:
116
117private:
118 vtkPSystemTools(const vtkPSystemTools&) VTK_DELETE_FUNCTION;
119 void operator=(const vtkPSystemTools&) VTK_DELETE_FUNCTION;
120};
121
122#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
System tools for file system introspection.
static void BroadcastString(std::string &, int proc)
Given a string on process proc, broadcast that string to all of the other processes.
static bool FileIsDirectory(const std::string &name)
Return true if the file is a directory.
static bool FindProgramPath(const char *argv0, std::string &pathOut, std::string &errorMsg, const char *exeName=0, const char *buildDir=0, const char *installPrefix=0)
Given argv[0] for a unix program find the full path to a running executable.
static std::string CollapseFullPath(const std::string &in_relative, const char *in_base)
static bool FileExists(const char *filename)
static vtkPSystemTools * New()
static bool FileExists(const std::string &filename, bool isFile)
static bool FileExists(const std::string &filename)
static std::string GetCurrentWorkingDirectory(bool collapse=true)
Get current working directory CWD.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static bool FileExists(const char *filename, bool isFile)
Return true if a file exists in the current directory.
static std::string CollapseFullPath(const std::string &in_relative)
Given a path to a file or directory, convert it to a full path.
static std::string GetProgramPath(const std::string &)
Given the path to a program executable, get the directory part of the path with the file stripped off...
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490