Last change
on this file since 103 was
81,
checked in by rosiere, 16 years ago
|
- Finish Environment (and test)
- Continue predictor_unit
- Add external tools
- svn keyword "Id" set
|
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2] | 1 | #ifdef VHDL |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | * $Id: Vhdl_get_list.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/include/Vhdl.h" |
---|
| 11 | |
---|
| 12 | #include <sstream> |
---|
| 13 | |
---|
| 14 | namespace morpheo { |
---|
| 15 | namespace behavioural { |
---|
| 16 | |
---|
[43] | 17 | #undef FUNCTION |
---|
| 18 | #define FUNCTION "Vhdl::get_list" |
---|
[71] | 19 | std::string Vhdl::get_list (std::list<std::string> liste , |
---|
| 20 | uint32_t depth , |
---|
| 21 | std::string separator , |
---|
| 22 | bool last_separator ) |
---|
[2] | 23 | { |
---|
[43] | 24 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 25 | |
---|
[71] | 26 | std::list<std::string>::iterator i = liste.begin(); |
---|
| 27 | bool empty = liste.empty(); |
---|
[2] | 28 | |
---|
[71] | 29 | std::string tab = std::string(depth,'\t'); |
---|
| 30 | std::ostringstream text; |
---|
[2] | 31 | |
---|
| 32 | if (not empty) |
---|
| 33 | { |
---|
| 34 | // First |
---|
| 35 | if (i != liste.end()) |
---|
| 36 | { |
---|
| 37 | text << tab << *i; |
---|
| 38 | ++i; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | while (i != liste.end()) |
---|
| 42 | { |
---|
[71] | 43 | text << separator << std::endl; |
---|
[2] | 44 | text << tab << *i; |
---|
| 45 | ++i; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | if (last_separator) |
---|
[71] | 49 | text << separator << std::endl; |
---|
[2] | 50 | } |
---|
| 51 | |
---|
[43] | 52 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
| 53 | |
---|
[2] | 54 | return text.str(); |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | }; // end namespace behavioural |
---|
| 58 | }; // end namespace morpheo |
---|
| 59 | |
---|
| 60 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.