diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2008-08-25T13·31+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2008-08-25T13·31+0000 |
commit | b428adc267f23441be2f801239641aaf8419e4ba (patch) | |
tree | 8dbbe5171888a340b8bf223268a2c764d94d0bb3 /src/libutil/util.hh | |
parent | cc826dc03e738c1d6c6fd6de0dfd9600f6289b72 (diff) |
* Strip off the `.nix' suffix from the attribute name for files in
~/.nix-defexpr, otherwise the attribute cannot be selected with the `-A' option. Useful if you want to stick a Nix expression directly in ~/.nix-defexpr.
Diffstat (limited to 'src/libutil/util.hh')
-rw-r--r-- | src/libutil/util.hh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 6c67e450b557..1fd89f3a55bf 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -294,6 +294,10 @@ bool string2Int(const string & s, int & n); bool string2Int(const string & s, long long & n); +/* Return true iff `s' ends in `suffix'. */ +bool hasSuffix(const string & s, const string & suffix); + + /* Exception handling in destructors: print an error message, then ignore the exception. */ void ignoreException(); |