From: "Petteri Räty" <betelgeuse@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/libbash:master commit in: src/core/
Date: Sat, 11 Jun 2011 08:52:14 +0000 (UTC) [thread overview]
Message-ID: <a10aa4fcd41b4b636a36e42ddbf60650108c20d8.betelgeuse@gentoo> (raw)
commit: a10aa4fcd41b4b636a36e42ddbf60650108c20d8
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 10 03:42:47 2011 +0000
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri Jun 10 08:25:09 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a10aa4fc
Core: declared some methods to be const
Some methods should have been declared to be const. Now this is fixed.
---
src/core/interpreter.cpp | 4 ++--
src/core/interpreter.h | 8 ++++----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/core/interpreter.cpp b/src/core/interpreter.cpp
index d1eb411..fedbee4 100644
--- a/src/core/interpreter.cpp
+++ b/src/core/interpreter.cpp
@@ -236,7 +236,7 @@ void interpreter::get_all_elements_IFS_joined(const std::string& name,
result);
}
-void interpreter::split_word(const std::string& word, std::vector<std::string>& output)
+void interpreter::split_word(const std::string& word, std::vector<std::string>& output) const
{
const std::string& delimeter = resolve<std::string>("IFS");
std::string trimmed(word);
@@ -313,7 +313,7 @@ void interpreter::trim_trailing_eols(std::string& value)
boost::trim_right_if(value, boost::is_any_of("\n"));
}
-void interpreter::get_all_function_names(std::vector<std::string>& function_names)
+void interpreter::get_all_function_names(std::vector<std::string>& function_names) const
{
boost::copy(functions | boost::adaptors::map_keys, back_inserter(function_names));
}
diff --git a/src/core/interpreter.h b/src/core/interpreter.h
index 38b4c94..937edd8 100644
--- a/src/core/interpreter.h
+++ b/src/core/interpreter.h
@@ -245,7 +245,7 @@ public:
/// \brief get the return status of the last command
/// \param the value of the return status
template <typename T=int>
- T get_status(void)
+ T get_status(void) const
{
return resolve<T>("?");
}
@@ -322,12 +322,12 @@ public:
/// \brief check if we have 'name' defined as a function
/// \param function name
/// \return whether 'name' is a function
- bool has_function(const std::string& name)
+ bool has_function(const std::string& name) const
{
return functions.find(name) != functions.end();
}
- void get_all_function_names(std::vector<std::string>& function_names);
+ void get_all_function_names(std::vector<std::string>& function_names) const;
/// \brief execute builtin
/// \param builtin name
@@ -430,7 +430,7 @@ public:
/// \brief implementation of word splitting
/// \param the value of the word
//. \param[out] the splitted result will be appended to output
- void split_word(const std::string& word, std::vector<std::string>& output);
+ void split_word(const std::string& word, std::vector<std::string>& output) const;
/// \brief get the status of shell optional behavior
/// \param the option name
next reply other threads:[~2011-06-11 8:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 8:52 Petteri Räty [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-08-04 14:24 [gentoo-commits] proj/libbash:master commit in: src/core/ Petteri Räty
2011-07-08 14:03 Petteri Räty
2011-06-11 8:24 Petteri Räty
2011-06-09 11:46 Petteri Räty
2011-06-09 7:27 Petteri Räty
2011-06-03 14:48 Petteri Räty
2011-05-23 14:34 Petteri Räty
2011-05-06 10:29 Petteri Räty
2011-04-20 14:04 Petteri Räty
2011-04-08 11:12 Petteri Räty
2011-04-06 7:43 Petteri Räty
2011-04-02 15:50 Petteri Räty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a10aa4fcd41b4b636a36e42ddbf60650108c20d8.betelgeuse@gentoo \
--to=betelgeuse@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox