CatapultServer  v0.5.0.1 (Elephant)
StringOutputStream.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "Stream.h"
23 
24 namespace catapult { namespace io {
25 
28  public:
30  explicit StringOutputStream(size_t capacity) {
31  m_output.reserve(capacity);
32  }
33 
34  public:
35  void write(const RawBuffer& buffer) override {
36  m_output.append(reinterpret_cast<const char*>(buffer.pData), buffer.Size);
37  }
38 
39  void flush() override
40  {}
41 
42  public:
44  const std::string& str() const {
45  return m_output;
46  }
47 
48  private:
49  std::string m_output;
50  };
51 }}
catapult::io::StringOutputStream::flush
void flush() override
Definition: StringOutputStream.h:39
catapult::io::StringOutputStream::m_output
std::string m_output
Definition: StringOutputStream.h:49
catapult::validators::Notification
model::AccountAddressNotification Notification
Definition: AddressValidator.cpp:27
catapult::io::StringOutputStream::str
const std::string & str() const
Returns underlying string.
Definition: StringOutputStream.h:44
catapult::io::StringOutputStream::StringOutputStream
StringOutputStream(size_t capacity)
Creates string output stream with reserved capacity.
Definition: StringOutputStream.h:30
catapult::io::StringOutputStream::write
void write(const RawBuffer &buffer) override
Definition: StringOutputStream.h:35
catapult::validators::ValidationResult::Success
Validation succeeded.
ArraySet.h
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::io::StringOutputStream
String output stream.
Definition: StringOutputStream.h:27
catapult::validators::DEFINE_STATELESS_VALIDATOR
DEFINE_STATELESS_VALIDATOR(TransactionFee, [](const auto &notification) { if(notification.Fee > notification.MaxFee) return Failure_Core_Invalid_Transaction_Fee;constexpr auto Max_Raw_Block_Fee_Multiplier=static_cast< uint64_t >(std::numeric_limits< BlockFeeMultiplier::ValueType >::max());return notification.MaxFee.unwrap() > Max_Raw_Block_Fee_Multiplier *notification.TransactionSize ? Failure_Core_Invalid_Transaction_Fee :ValidationResult::Success;})
Stream.h
Validators.h
catapult::io::OutputStream
Writer interface.
Definition: Stream.h:41
catapult::utils::RawBuffer
BasicRawBuffer< const uint8_t > RawBuffer
A const binary buffer.
Definition: RawBuffer.h:62