Skip to content

Commit a690f14

Browse files
committed
Removed most throw declarations (deprecated by C++0x and dangerous)
1 parent e681c50 commit a690f14

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

include/cucumber-cpp/internal/Table.hpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,22 @@ class Table {
1818
typedef basic_type row_type;
1919
typedef std::vector<hash_row_type> hashes_type;
2020

21-
void addColumn(const std::string column) throw (std::runtime_error);
22-
void addRow(const row_type &row) throw (std::range_error, std::runtime_error);
21+
/**
22+
* @brief addColumn
23+
* @param column
24+
*
25+
* @throws std::runtime_error
26+
*/
27+
void addColumn(const std::string column);
28+
29+
/**
30+
* @brief addRow
31+
* @param row
32+
*
33+
* @throws std::range_error
34+
* @throws std::runtime_error
35+
*/
36+
void addRow(const row_type &row);
2337
const hashes_type & hashes() const;
2438

2539
private:

include/cucumber-cpp/internal/connectors/wire/WireProtocol.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ class WireMessageCodec {
130130
* @param One single message to decode
131131
*
132132
* @return The decoded command (ownership passed to the caller)
133+
*
134+
* @throws WireMessageCodecException
133135
*/
134-
virtual WireCommand *decode(const std::string &request) const throw(WireMessageCodecException) = 0;
136+
virtual WireCommand *decode(const std::string &request) const = 0;
135137

136138
/**
137139
* Encodes a response to wire format.
@@ -151,7 +153,7 @@ class WireMessageCodec {
151153
class JsonSpiritWireMessageCodec : public WireMessageCodec {
152154
public:
153155
JsonSpiritWireMessageCodec();
154-
WireCommand *decode(const std::string &request) const throw(WireMessageCodecException);
156+
WireCommand *decode(const std::string &request) const;
155157
const std::string encode(const WireResponse *response) const;
156158
};
157159

src/Table.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
namespace cucumber {
44
namespace internal {
55

6-
void Table::addColumn(const std::string column) throw (std::runtime_error) {
6+
void Table::addColumn(const std::string column) {
77
if (rows.empty()) {
88
columns.push_back(column);
99
} else {
1010
throw std::runtime_error("Cannot alter columns after rows have been added");
1111
}
1212
}
1313

14-
void Table::addRow(const row_type &row) throw (std::range_error, std::runtime_error) {
14+
void Table::addRow(const row_type &row) {
1515
const basic_type::size_type colSize = columns.size();
1616
if (colSize == 0) {
1717
throw std::runtime_error("No column defined yet");

src/connectors/wire/WireProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static std::map<std::string, boost::shared_ptr<CommandDecoder> > commandDecoders
204204

205205
JsonSpiritWireMessageCodec::JsonSpiritWireMessageCodec() {};
206206

207-
WireCommand *JsonSpiritWireMessageCodec::decode(const std::string &request) const throw(WireMessageCodecException) {
207+
WireCommand *JsonSpiritWireMessageCodec::decode(const std::string &request) const {
208208
std::istringstream is(request);
209209
mValue json;
210210
try {

0 commit comments

Comments
 (0)