Since standard strings can contain raw, binary data in addition to textual data, I've extended the AbstractConfiguration interface to support strings containing binary data.
- Code: Select all
namespace MyPocoExtensions {
typedef unsigned char Byte;
typedef std::basic_string<Byte> Data;
class AbstractConfiguration
{
public:
Data getData (const std::string&);
void setData (const std::string&, const Data&);
void setData (const std::string&, const Byte*, size_t);
};
} // namespace MyPocoExtensions
There's really no difference implementation-wise; the difference is mostly semantic.
My question though is, can the configuration file classes (e.g. PropertyFileConfiguration, XMLConfiguration, etc.) also be extended to support binary data? If so, which format would be most dependable, flexible? XMLConfiguration?
Thanks,
Eric.





