Refactor how properties are parsed

This commit is contained in:
Martin Hurton
2013-06-22 19:02:08 +02:00
parent 084e8792de
commit 99d4974580
10 changed files with 112 additions and 156 deletions

View File

@@ -69,6 +69,20 @@ namespace zmq
size_t add_property (unsigned char *ptr, const char *name,
const void *value, size_t value_len) const;
// Parse a list of properties. Returns 0 on success
// and -1 on error, in which case errno is set.
int parse_properties (const unsigned char *ptr_, size_t length);
// This is called by parse_property method whenever it
// parses a new property. The function should return 0
// on success and -1 on error, in which case it should
// set errno. Signaling error prevetns parser from
// parsing remaining data.
// Derived classes are supposed to override this
// method to handle custom processing.
virtual int property (const std::string name_,
const void *value_, size_t length_);
options_t options;
private: