source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Vhdl_get_list.cpp @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 972 bytes
Line 
1#ifdef VHDL
2
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/include/Vhdl.h"
11
12#include <sstream>
13using namespace std;
14
15namespace morpheo              {
16namespace 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.