00001 /* 00002 * See the dyninst/COPYRIGHT file for copyright information. 00003 * 00004 * We provide the Paradyn Tools (below described as "Paradyn") 00005 * on an AS IS basis, and do not warrant its validity or performance. 00006 * We reserve the right to update, modify, or discontinue this 00007 * software at any time. We shall have no obligation to supply such 00008 * updates or modifications or any other form of support to you. 00009 * 00010 * By your use of Paradyn, you understand and agree that we (or any 00011 * other person or entity with proprietary rights in Paradyn) are 00012 * under no obligation to provide either maintenance services, 00013 * update services, notices of latent defects, or correction of 00014 * defects for Paradyn. 00015 * 00016 * This library is free software; you can redistribute it and/or 00017 * modify it under the terms of the GNU Lesser General Public 00018 * License as published by the Free Software Foundation; either 00019 * version 2.1 of the License, or (at your option) any later version. 00020 * 00021 * This library is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 * Lesser General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU Lesser General Public 00027 * License along with this library; if not, write to the Free Software 00028 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00029 */ 00030 00031 00032 // pathName.h 00033 00034 #ifndef _PATH_NAME_H_ 00035 #define _PATH_NAME_H_ 00036 00037 #include "headers.h" 00038 00039 #include <string> 00040 00041 00042 std::string expand_tilde_pathname(const std::string &dir); 00043 // e.g. convert "~tamches/hello" to "/u/t/a/tamches/hello", 00044 // or convert "~/hello" to same. 00045 // In the spirit of Tcl_TildeSubst 00046 00047 std::string concat_pathname_components(const std::string &part1, const std::string &part2); 00048 // concatenate path1 and part2, adding a "/" between them if neither 00049 // part1 ends in a "/" or part2 begins in one. 00050 00051 bool extractNextPathElem(const char * &ptr, std::string &result); 00052 // assumes that "ptr" points to the value of the PATH environment 00053 // variable. Extracts the next element (writing to result, updating 00054 // ptr, returning true) if available else returns false; 00055 00056 bool exists_executable(const std::string &fullpathname); 00057 00058 00059 00060 bool executableFromArgv0AndPathAndCwd(std::string &result, 00061 const std::string &i_argv0, 00062 const std::string &path, 00063 const std::string &cwd); 00064 COMMON_EXPORT std::string extract_pathname_tail(const std::string &path); 00065 00066 COMMON_EXPORT std::string resolve_file_path(const char *fname); 00067 #endif
1.6.1