|
|
@ -193,11 +193,12 @@ public:
|
|
|
|
|
|
|
|
|
|
|
|
std::string getString(size_t length)
|
|
|
|
std::string getString(size_t length)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::string str;
|
|
|
|
std::vector<char> str (length+1, 0);
|
|
|
|
str.resize(length);
|
|
|
|
|
|
|
|
if(inp->read(&str[0], length) != length)
|
|
|
|
if(inp->read(&str[0], length) != length)
|
|
|
|
return std::string();
|
|
|
|
throw std::runtime_error ("string length in NIF file does not match");
|
|
|
|
return str.substr(0, str.find('\0'));
|
|
|
|
|
|
|
|
|
|
|
|
return &str[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
std::string getString()
|
|
|
|
std::string getString()
|
|
|
|
{
|
|
|
|
{
|
|
|
|