Line | |
---|
1 | #ifdef VHDL |
---|
2 | |
---|
3 | /* |
---|
4 | * $Id$ |
---|
5 | * |
---|
6 | * [ Description ] |
---|
7 | * |
---|
8 | */ |
---|
9 | |
---|
10 | #include "Behavioural/include/Vhdl.h" |
---|
11 | |
---|
12 | #include <sstream> |
---|
13 | using namespace std; |
---|
14 | |
---|
15 | namespace morpheo { |
---|
16 | namespace behavioural { |
---|
17 | |
---|
18 | string Vhdl::get_list (list<string> liste , |
---|
19 | uint32_t depth , |
---|
20 | string separator , |
---|
21 | bool last_separator ) |
---|
22 | { |
---|
23 | list<string>::iterator i = liste.begin(); |
---|
24 | bool empty = liste.empty(); |
---|
25 | |
---|
26 | string tab = string(depth,'\t'); |
---|
27 | ostringstream text; |
---|
28 | |
---|
29 | if (not empty) |
---|
30 | { |
---|
31 | // First |
---|
32 | if (i != liste.end()) |
---|
33 | { |
---|
34 | text << tab << *i; |
---|
35 | ++i; |
---|
36 | } |
---|
37 | |
---|
38 | while (i != liste.end()) |
---|
39 | { |
---|
40 | text << separator << endl; |
---|
41 | text << tab << *i; |
---|
42 | ++i; |
---|
43 | } |
---|
44 | |
---|
45 | if (last_separator) |
---|
46 | text << separator << endl; |
---|
47 | } |
---|
48 | |
---|
49 | return text.str(); |
---|
50 | }; |
---|
51 | |
---|
52 | }; // end namespace behavioural |
---|
53 | }; // end namespace morpheo |
---|
54 | |
---|
55 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.