summaryrefslogtreecommitdiff
path: root/src/tools.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-12-23 14:07:46 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2025-12-23 14:15:15 +0100
commit293ccba26f5cd17521df7b4641989dd771865415 (patch)
treed6782d07219f333c4a5e29f7c3939d1ff0567676 /src/tools.h
parent4b72df8f8e32aad83b628fb2f1c852cb108c2aba (diff)
Use std::string_view instead of std::string in tools.cc whenever applicable
Diffstat (limited to 'src/tools.h')
-rw-r--r--src/tools.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/tools.h b/src/tools.h
index 0e7fc15..b8df022 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -18,10 +18,10 @@ std::ostream& operator<<(std::ostream& stream, const ctor::ar_opt& opt);
std::ostream& operator<<(std::ostream& stream, const ctor::asm_opt& opt);
std::string get_arch(ctor::output_system system);
-ctor::arch get_arch(ctor::output_system system, const std::string& str);
+ctor::arch get_arch(ctor::output_system system, std::string_view str);
//! Get tool-chain type from compiler path string
-ctor::toolchain getToolChain(const std::string& compiler);
+ctor::toolchain getToolChain(std::string_view compiler);
//! Get tool-chain type from output system (via configuration)
ctor::toolchain getToolChain(ctor::output_system system);
@@ -32,63 +32,63 @@ ctor::toolchain getToolChain(ctor::output_system system);
//! tool-chain
std::vector<std::string> c_option(ctor::toolchain toolchain,
ctor::c_opt option,
- const std::string& arg = {},
- const std::string& arg2 = {});
+ std::string_view arg = {},
+ std::string_view arg2 = {});
//! Get tool argument(s) for specific option type matching the supplied
//! tool-chain
std::vector<std::string> cxx_option(ctor::toolchain toolchain,
ctor::cxx_opt option,
- const std::string& arg = {},
- const std::string& arg2 = {});
+ std::string_view arg = {},
+ std::string_view arg2 = {});
//! Get tool argument(s) for specific option type matching the supplied
//! tool-chain
std::vector<std::string> ld_option(ctor::toolchain toolchain,
ctor::ld_opt option,
- const std::string& arg = {},
- const std::string& arg2 = {});
+ std::string_view arg = {},
+ std::string_view arg2 = {});
//! Get tool argument(s) for specific option type matching the supplied
//! tool-chain
std::vector<std::string> ar_option(ctor::toolchain toolchain,
ctor::ar_opt option,
- const std::string& arg = {},
- const std::string& arg2 = {});
+ std::string_view arg = {},
+ std::string_view arg2 = {});
//! Get tool argument(s) for specific option type matching the supplied
//! tool-chain
std::vector<std::string> asm_option(ctor::toolchain toolchain,
ctor::asm_opt option,
- const std::string& arg = {},
- const std::string& arg2 = {});
+ std::string_view arg = {},
+ std::string_view arg2 = {});
//! Get ctor::c_opt enum value and argument from string,
//! ie. { ctor::c_opt::inlude_path, "foo/bar" } from "-Ifoo/bar"
//! Returns { ctor::c_opt::custom, flag } if unknown.
-ctor::c_flag c_option(const std::string& flag, ctor::toolchain toolchain);
+ctor::c_flag c_option(std::string_view flag, ctor::toolchain toolchain);
//! Get ctor::cxx_opt enum value and argument from string,
//! ie. { ctor::cxx_opt::inlude_path, "foo/bar" } from "-Ifoo/bar"
//! Returns { ctor::cxx_opt::custom, flag } if unknown.
-ctor::cxx_flag cxx_option(const std::string& flag, ctor::toolchain toolchain);
+ctor::cxx_flag cxx_option(std::string_view flag, ctor::toolchain toolchain);
//! Get ctor::ld_opt enum value and argument from string,
//! ie. { ctor::ld_opt::inlude_path, "foo/bar" } from "-Ifoo/bar"
//! Returns { ctor::ld_opt::custom, flag } if unknown.
-ctor::ld_flag ld_option(const std::string& flag, ctor::toolchain toolchain);
+ctor::ld_flag ld_option(std::string_view flag, ctor::toolchain toolchain);
//! Get ctor::ar_opt enum value and argument from string,
//! ie. { ctor::ar_opt::inlude_path, "foo/bar" } from "-Ifoo/bar"
//! Returns { ctor::ar_opt::custom, flag } if unknown.
-ctor::ar_flag ar_option(const std::string& flag, ctor::toolchain toolchain);
+ctor::ar_flag ar_option(std::string_view flag, ctor::toolchain toolchain);
//! Get ctor::asm_opt enum value and argument from string,
//! ie. { ctor::asm_opt::inlude_path, "foo/bar" } from "-Ifoo/bar"
//! Returns { ctor::asm_opt::custom, flag } if unknown.
-ctor::asm_flag asm_option(const std::string& flag, ctor::toolchain toolchain);
+ctor::asm_flag asm_option(std::string_view flag, ctor::toolchain toolchain);