e8ed7b1d1b
This patch adds a tool called DSENT to the ext/ directory. DSENT is a tool that models power and area for on-chip networks. The next patch adds a script for using the tool.
38 lines
1 KiB
C++
38 lines
1 KiB
C++
#ifndef __LIBUTIL_CONFIG_H__
|
|
#define __LIBUTIL_CONFIG_H__
|
|
|
|
#include <iostream>
|
|
|
|
#include "Map.h"
|
|
|
|
namespace LibUtil
|
|
{
|
|
class Config : public StringMap
|
|
{
|
|
public:
|
|
Config(const String& delimiter_ = "=", const String& comment_ = "#", const String& sentry_ = "End");
|
|
Config(const Config& config_);
|
|
virtual ~Config();
|
|
|
|
public:
|
|
// Make a copy of this instance
|
|
virtual Config* clone() const;
|
|
// Load the config from file
|
|
virtual void readFile(const String& filename_);
|
|
// Parse string and overwrite the Config instance if keys exist
|
|
virtual void readString(const String& str_);
|
|
|
|
// Write or read map using standard IO
|
|
friend std::ostream& operator<<(std::ostream& ost_, const Config& config_);
|
|
friend std::istream& operator>>(std::istream& ist_, Config& config_);
|
|
|
|
protected:
|
|
String mDelimiter;
|
|
String mComment;
|
|
String mSentry;
|
|
};
|
|
}
|
|
|
|
#endif // __LIBUTIL_CONFIG_H__
|
|
|