mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
commit
b3e8d72770
27 changed files with 231 additions and 37 deletions
|
@ -366,6 +366,14 @@ template<class N> bool string2Int(const string & s, N & n)
|
|||
return str && str.get() == EOF;
|
||||
}
|
||||
|
||||
/* Parse a string into a float. */
|
||||
template<class N> bool string2Float(const string & s, N & n)
|
||||
{
|
||||
std::istringstream str(s);
|
||||
str >> n;
|
||||
return str && str.get() == EOF;
|
||||
}
|
||||
|
||||
|
||||
/* Return true iff `s' ends in `suffix'. */
|
||||
bool hasSuffix(const string & s, const string & suffix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue