summaryrefslogtreecommitdiff
path: root/src/bin/eolian_mono/eolian/mono/utils.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-03-19 20:35:36 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-03-20 16:50:30 -0300
commitf9586a831b8ba13542f59c9e1143c3d7b276bd51 (patch)
treebf1c81ace60441c4cf4007709ae32580db8ee58d /src/bin/eolian_mono/eolian/mono/utils.hh
parent9a6dd32cb1e8f5b1bcd23d32fc4b2d5fa425abbd (diff)
csharp: Add support for efl parts as Properties
Instead of var bg = efl.ui.Background.static_cast(myobj.Part("background")); Now do var bg = myobj.Background; Also a couple helper functions were added.
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/utils.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/utils.hh13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/utils.hh b/src/bin/eolian_mono/eolian/mono/utils.hh
index 3e48e518b5..6be2076caa 100644
--- a/src/bin/eolian_mono/eolian/mono/utils.hh
+++ b/src/bin/eolian_mono/eolian/mono/utils.hh
@@ -4,19 +4,28 @@
4#include <string> 4#include <string>
5#include <algorithm> 5#include <algorithm>
6 6
7/* Compared to the helpers.hh header, these functions are lower level, not dealing with
8 * binding-specific structures or knowledge */
9
7namespace eolian_mono { namespace utils { 10namespace eolian_mono { namespace utils {
8 11
9 // Helper method to avoid multiple as_generator calls when mixing case strings 12 // Helper method to avoid multiple as_generator calls when mixing case strings
10 std::string to_uppercase(std::string s) 13 inline std::string to_uppercase(std::string s)
11 { 14 {
12 std::transform(s.begin(), s.end(), s.begin(), ::toupper); 15 std::transform(s.begin(), s.end(), s.begin(), ::toupper);
13 return s; 16 return s;
14 } 17 }
15 std::string to_lowercase(std::string s) 18 inline std::string to_lowercase(std::string s)
16 { 19 {
17 std::transform(s.begin(), s.end(), s.begin(), ::tolower); 20 std::transform(s.begin(), s.end(), s.begin(), ::tolower);
18 return s; 21 return s;
19 } 22 }
23 inline std::string capitalize(std::string const &s)
24 {
25 std::string ret = s;
26 ret[0] = std::toupper(ret[0]);
27 return ret;
28 }
20} } 29} }
21 30
22#endif 31#endif