mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-30 22:18:46 +00:00
* Add a std::ostream inserter for sys::Path
* Correct the std::string constructor to take a const reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18877 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <ostream>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
namespace sys {
|
namespace sys {
|
||||||
@@ -161,7 +162,7 @@ namespace sys {
|
|||||||
/// @throws std::string if the path string is not legal.
|
/// @throws std::string if the path string is not legal.
|
||||||
/// @param unverified_path The path to verify and assign.
|
/// @param unverified_path The path to verify and assign.
|
||||||
/// @brief Construct a Path from a string.
|
/// @brief Construct a Path from a string.
|
||||||
explicit Path(std::string unverified_path);
|
explicit Path(const std::string& unverified_path);
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Operators
|
/// @name Operators
|
||||||
@@ -547,6 +548,11 @@ namespace sys {
|
|||||||
LLVMFileType IdentifyFileType(const char*magic, unsigned length);
|
LLVMFileType IdentifyFileType(const char*magic, unsigned length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::ostream& operator<<(std::ostream& strm, const sys::Path& aPath) {
|
||||||
|
strm << aPath.toString();
|
||||||
|
return strm;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// vim: sw=2
|
// vim: sw=2
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
using namespace sys;
|
using namespace sys;
|
||||||
|
|
||||||
Path::Path(std::string unverified_path)
|
Path::Path(const std::string& unverified_path)
|
||||||
: path(unverified_path)
|
: path(unverified_path)
|
||||||
{
|
{
|
||||||
if (unverified_path.empty())
|
if (unverified_path.empty())
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
namespace llvm {
|
namespace llvm {
|
||||||
using namespace sys;
|
using namespace sys;
|
||||||
|
|
||||||
Path::Path(std::string unverified_path)
|
Path::Path(const std::string& unverified_path)
|
||||||
: path(unverified_path)
|
: path(unverified_path)
|
||||||
{
|
{
|
||||||
if (unverified_path.empty())
|
if (unverified_path.empty())
|
||||||
|
@@ -97,7 +97,7 @@ Path::GetTemporaryDirectory() {
|
|||||||
return *TempDirectory;
|
return *TempDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
Path::Path(std::string unverified_path)
|
Path::Path(const std::string& unverified_path)
|
||||||
: path(unverified_path)
|
: path(unverified_path)
|
||||||
{
|
{
|
||||||
FlipBackSlashes(path);
|
FlipBackSlashes(path);
|
||||||
|
@@ -97,7 +97,7 @@ Path::GetTemporaryDirectory() {
|
|||||||
return *TempDirectory;
|
return *TempDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
Path::Path(std::string unverified_path)
|
Path::Path(const std::string& unverified_path)
|
||||||
: path(unverified_path)
|
: path(unverified_path)
|
||||||
{
|
{
|
||||||
FlipBackSlashes(path);
|
FlipBackSlashes(path);
|
||||||
|
Reference in New Issue
Block a user