From 108d3d40c5b8930b772ebd3db38c9ed9643d4402 Mon Sep 17 00:00:00 2001 From: Derek Bankieris Date: Fri, 21 Oct 2016 15:06:35 -0500 Subject: [PATCH] Added a version of almostRealPath that takes a const std::string& parameter so we don't have to use c_str() everywhere --- trick_source/codegen/Interface_Code_Gen/Utilities.cpp | 4 ++++ trick_source/codegen/Interface_Code_Gen/Utilities.hh | 1 + 2 files changed, 5 insertions(+) diff --git a/trick_source/codegen/Interface_Code_Gen/Utilities.cpp b/trick_source/codegen/Interface_Code_Gen/Utilities.cpp index 2e35ad70..356a5e8b 100644 --- a/trick_source/codegen/Interface_Code_Gen/Utilities.cpp +++ b/trick_source/codegen/Interface_Code_Gen/Utilities.cpp @@ -69,6 +69,10 @@ std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl } #include +char * almostRealPath( const std::string& in_path ) { + return almostRealPath(in_path.c_str()); +} + /* This function returns almost absolute path of the directory of the incoming path. It does not follow the last symbolic link. diff --git a/trick_source/codegen/Interface_Code_Gen/Utilities.hh b/trick_source/codegen/Interface_Code_Gen/Utilities.hh index 22ad6403..6fbaec59 100644 --- a/trick_source/codegen/Interface_Code_Gen/Utilities.hh +++ b/trick_source/codegen/Interface_Code_Gen/Utilities.hh @@ -17,6 +17,7 @@ std::string trim( const std::string& str, const std::string& whitespace = " \t\n bool isInUserCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ; bool isInUserOrTrickCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ; std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ; +char * almostRealPath( const std::string& in_path ) ; char * almostRealPath( const char * in_path ) ; std::string color(const Color& color, const std::string& text);