1 |
commit: a10aa4fcd41b4b636a36e42ddbf60650108c20d8 |
2 |
Author: Mu Qiao <qiaomuf <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 10 03:42:47 2011 +0000 |
4 |
Commit: Petteri Räty <betelgeuse <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 10 08:25:09 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=a10aa4fc |
7 |
|
8 |
Core: declared some methods to be const |
9 |
|
10 |
Some methods should have been declared to be const. Now this is fixed. |
11 |
|
12 |
--- |
13 |
src/core/interpreter.cpp | 4 ++-- |
14 |
src/core/interpreter.h | 8 ++++---- |
15 |
2 files changed, 6 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/src/core/interpreter.cpp b/src/core/interpreter.cpp |
18 |
index d1eb411..fedbee4 100644 |
19 |
--- a/src/core/interpreter.cpp |
20 |
+++ b/src/core/interpreter.cpp |
21 |
@@ -236,7 +236,7 @@ void interpreter::get_all_elements_IFS_joined(const std::string& name, |
22 |
result); |
23 |
} |
24 |
|
25 |
-void interpreter::split_word(const std::string& word, std::vector<std::string>& output) |
26 |
+void interpreter::split_word(const std::string& word, std::vector<std::string>& output) const |
27 |
{ |
28 |
const std::string& delimeter = resolve<std::string>("IFS"); |
29 |
std::string trimmed(word); |
30 |
@@ -313,7 +313,7 @@ void interpreter::trim_trailing_eols(std::string& value) |
31 |
boost::trim_right_if(value, boost::is_any_of("\n")); |
32 |
} |
33 |
|
34 |
-void interpreter::get_all_function_names(std::vector<std::string>& function_names) |
35 |
+void interpreter::get_all_function_names(std::vector<std::string>& function_names) const |
36 |
{ |
37 |
boost::copy(functions | boost::adaptors::map_keys, back_inserter(function_names)); |
38 |
} |
39 |
|
40 |
diff --git a/src/core/interpreter.h b/src/core/interpreter.h |
41 |
index 38b4c94..937edd8 100644 |
42 |
--- a/src/core/interpreter.h |
43 |
+++ b/src/core/interpreter.h |
44 |
@@ -245,7 +245,7 @@ public: |
45 |
/// \brief get the return status of the last command |
46 |
/// \param the value of the return status |
47 |
template <typename T=int> |
48 |
- T get_status(void) |
49 |
+ T get_status(void) const |
50 |
{ |
51 |
return resolve<T>("?"); |
52 |
} |
53 |
@@ -322,12 +322,12 @@ public: |
54 |
/// \brief check if we have 'name' defined as a function |
55 |
/// \param function name |
56 |
/// \return whether 'name' is a function |
57 |
- bool has_function(const std::string& name) |
58 |
+ bool has_function(const std::string& name) const |
59 |
{ |
60 |
return functions.find(name) != functions.end(); |
61 |
} |
62 |
|
63 |
- void get_all_function_names(std::vector<std::string>& function_names); |
64 |
+ void get_all_function_names(std::vector<std::string>& function_names) const; |
65 |
|
66 |
/// \brief execute builtin |
67 |
/// \param builtin name |
68 |
@@ -430,7 +430,7 @@ public: |
69 |
/// \brief implementation of word splitting |
70 |
/// \param the value of the word |
71 |
//. \param[out] the splitted result will be appended to output |
72 |
- void split_word(const std::string& word, std::vector<std::string>& output); |
73 |
+ void split_word(const std::string& word, std::vector<std::string>& output) const; |
74 |
|
75 |
/// \brief get the status of shell optional behavior |
76 |
/// \param the option name |