diff options
author | Mike Buland <eichlan@xagasoft.com> | 2010-04-23 15:14:00 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2010-04-23 15:14:00 +0000 |
commit | 801e7de1f85656746d832508baf4583907826420 (patch) | |
tree | 6e2639b6904ee8bcef2781420741124948c17f2c /src/list.h | |
parent | d8a8c482b2f6b09ee8995b9563397a9b9bd135e8 (diff) | |
download | libbu++-801e7de1f85656746d832508baf4583907826420.tar.gz libbu++-801e7de1f85656746d832508baf4583907826420.tar.bz2 libbu++-801e7de1f85656746d832508baf4583907826420.tar.xz libbu++-801e7de1f85656746d832508baf4583907826420.zip |
Minor updates to the List class, unchecked corner cases.
The CsvWriter now writes csv. It understands both excel formatting and c-style,
which I made up myself (it's just c-style escape sequences).
Sha1 is converted to work with the CryptoHash API and it does indeed work.
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -871,6 +871,8 @@ namespace Bu | |||
871 | */ | 871 | */ |
872 | value &first() | 872 | value &first() |
873 | { | 873 | { |
874 | if( core->pFirst->pValue == NULL ) | ||
875 | throw Bu::ExceptionBase("Attempt to read first element from empty list."); | ||
874 | _hardCopy(); | 876 | _hardCopy(); |
875 | return *core->pFirst->pValue; | 877 | return *core->pFirst->pValue; |
876 | } | 878 | } |
@@ -881,6 +883,8 @@ namespace Bu | |||
881 | */ | 883 | */ |
882 | const value &first() const | 884 | const value &first() const |
883 | { | 885 | { |
886 | if( core->pFirst->pValue == NULL ) | ||
887 | throw Bu::ExceptionBase("Attempt to read first element from empty list."); | ||
884 | return *core->pFirst->pValue; | 888 | return *core->pFirst->pValue; |
885 | } | 889 | } |
886 | 890 | ||