rippled
ripple
protocol
impl
STBlob.cpp
1
//------------------------------------------------------------------------------
2
/*
3
This file is part of rippled: https://github.com/ripple/rippled
4
Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6
Permission to use, copy, modify, and/or distribute this software for any
7
purpose with or without fee is hereby granted, provided that the above
8
copyright notice and this permission notice appear in all copies.
9
10
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
*/
18
//==============================================================================
19
20
#include <ripple/protocol/STBlob.h>
21
#include <ripple/basics/StringUtilities.h>
22
23
namespace
ripple
{
24
25
STBlob::STBlob
(
SerialIter
& st,
SField
const
& name)
26
:
STBase
(name)
27
, value_ (st.getVLBuffer ())
28
{
29
}
30
31
std::string
32
STBlob::getText
()
const
33
{
34
return
strHex
(
value_
);
35
}
36
37
bool
38
STBlob::isEquivalent
(
const
STBase
& t)
const
39
{
40
const
STBlob
* v =
dynamic_cast<
const
STBlob
*
>
(&t);
41
return
v && (
value_
== v->
value_
);
42
}
43
44
}
// ripple
ripple::STBlob::STBlob
STBlob()=default
std::string
STL class.
ripple::STBlob::value_
Buffer value_
Definition:
STBlob.h:143
ripple::STBlob::getText
std::string getText() const override
Definition:
STBlob.cpp:32
ripple::SerialIter
Definition:
Serializer.h:311
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition:
RCLCensorshipDetector.h:29
ripple::SField
Identifies fields.
Definition:
SField.h:112
ripple::STBase
A type which can be exported to a well known binary format.
Definition:
STBase.h:65
ripple::STBlob::isEquivalent
bool isEquivalent(const STBase &t) const override
Definition:
STBlob.cpp:38
ripple::strHex
std::string strHex(FwdIt begin, FwdIt end)
Definition:
strHex.h:70
ripple::STBlob
Definition:
STBlob.h:33
Generated by
1.8.17