Last change
on this file since 125 was
88,
checked in by rosiere, 16 years ago
|
Almost complete design
with Test and test platform
|
-
Property svn:keywords set to
Id
|
File size:
833 bytes
|
Rev | Line | |
---|
[88] | 1 | /* |
---|
| 2 | * $Id: Instance_link2array.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Configuration/include/Instance.h" |
---|
| 9 | |
---|
| 10 | namespace morpheo { |
---|
| 11 | namespace behavioural { |
---|
| 12 | namespace configuration { |
---|
| 13 | |
---|
| 14 | #undef FUNCTION |
---|
| 15 | #define FUNCTION "Instance::link2array" |
---|
| 16 | std::vector<std::string> Instance::link2array (std::string str) |
---|
| 17 | { |
---|
| 18 | log_begin(Configuration,FUNCTION); |
---|
| 19 | |
---|
| 20 | std::vector<std::string> _return; |
---|
| 21 | |
---|
| 22 | size_t begin=0; |
---|
| 23 | size_t end =0; |
---|
| 24 | |
---|
| 25 | do |
---|
| 26 | { |
---|
| 27 | end = str.find_first_of(".",begin); // "." is the separator |
---|
| 28 | |
---|
| 29 | _return.push_back(str.substr(begin, end-begin)); |
---|
| 30 | |
---|
| 31 | begin = end+1; // next index |
---|
| 32 | } |
---|
| 33 | while (end!=std::string::npos); |
---|
| 34 | |
---|
| 35 | log_end(Configuration,FUNCTION); |
---|
| 36 | |
---|
| 37 | return _return; |
---|
| 38 | }; |
---|
| 39 | |
---|
| 40 | }; // end namespace configuration |
---|
| 41 | }; // end namespace behavioural |
---|
| 42 | }; // end namespace morpheo |
---|
Note: See
TracBrowser
for help on using the repository browser.