mirror of
https://github.com/NixOS/nix.git
synced 2024-11-30 02:32:26 +00:00
* Remove some obsolete functions.
This commit is contained in:
parent
d4f0b0fc6c
commit
0d272fca79
@ -951,53 +951,6 @@ void _interrupted()
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
string packStrings(const Strings & strings)
|
||||
{
|
||||
string d;
|
||||
for (Strings::const_iterator i = strings.begin();
|
||||
i != strings.end(); ++i)
|
||||
{
|
||||
unsigned int len = i->size();
|
||||
d += len & 0xff;
|
||||
d += (len >> 8) & 0xff;
|
||||
d += (len >> 16) & 0xff;
|
||||
d += (len >> 24) & 0xff;
|
||||
d += *i;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
Strings unpackStrings(const string & s)
|
||||
{
|
||||
Strings strings;
|
||||
|
||||
string::const_iterator i = s.begin();
|
||||
|
||||
while (i != s.end()) {
|
||||
|
||||
if (i + 4 > s.end())
|
||||
throw Error(format("short db entry: `%1%'") % s);
|
||||
|
||||
unsigned int len;
|
||||
len = (unsigned char) *i++;
|
||||
len |= ((unsigned char) *i++) << 8;
|
||||
len |= ((unsigned char) *i++) << 16;
|
||||
len |= ((unsigned char) *i++) << 24;
|
||||
|
||||
if (len == 0xffffffff) return strings; /* explicit end-of-list */
|
||||
|
||||
if (i + len > s.end())
|
||||
throw Error(format("short db entry: `%1%'") % s);
|
||||
|
||||
strings.push_back(string(i, i + len));
|
||||
i += len;
|
||||
}
|
||||
|
||||
return strings;
|
||||
}
|
||||
|
||||
|
||||
Strings tokenizeString(const string & s, const string & separators)
|
||||
{
|
||||
Strings result;
|
||||
|
@ -276,11 +276,6 @@ void inline checkInterrupt()
|
||||
MakeError(Interrupted, BaseError)
|
||||
|
||||
|
||||
/* String packing / unpacking. */
|
||||
string packStrings(const Strings & strings);
|
||||
Strings unpackStrings(const string & s);
|
||||
|
||||
|
||||
/* String tokenizer. */
|
||||
Strings tokenizeString(const string & s, const string & separators = " \t\n\r");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user