source: trunk/IPs/systemC/processor/Morpheo/Common/src/Basename.cpp

Last change on this file was 146, checked in by rosiere, 14 years ago

1) Integration of RegisterFile_Internal_Banked in RegisterFile?
2) Erase "read_write" interface in RegisterFile_Monolithic component
3) Add smith predictor parameters in Load_store_pointer_unit.
4) Fix not statistics flags

  • Property svn:keywords set to Id
File size: 535 bytes
Line 
1/*
2 * $Id: Basename.cpp 146 2011-02-01 20:57:54Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "../include/Basename.h"
9#include <libgen.h>
10
11namespace morpheo {
12
13  std::string basename (std::string str, bool keep_extension)
14  {
15    std::string res = ::basename(const_cast<char *>(str.c_str()));
16   
17    if (not keep_extension)
18      {
19        std::string::size_type index = res.rfind('.');
20       
21        if(index != std::string::npos)
22          {
23            res = res.substr(0,index);
24          }
25      }
26   
27    return res;
28  }
29 
30}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.