Reformatting using AStyle

This commit is contained in:
Vinnie Falco
2013-06-14 08:45:13 -07:00
parent 36bd8f7173
commit 521e812fc4
294 changed files with 54609 additions and 47598 deletions

View File

@@ -3,61 +3,62 @@ AccountState::AccountState (RippleAddress const& naAccountID)
: mAccountID (naAccountID)
, mValid (false)
{
if (naAccountID.isValid ())
if (naAccountID.isValid ())
{
mValid = true;
mValid = true;
mLedgerEntry = boost::make_shared <SerializedLedgerEntry> (
ltACCOUNT_ROOT, Ledger::getAccountRootIndex (naAccountID));
ltACCOUNT_ROOT, Ledger::getAccountRootIndex (naAccountID));
mLedgerEntry->setFieldAccount (sfAccount, naAccountID.getAccountID());
mLedgerEntry->setFieldAccount (sfAccount, naAccountID.getAccountID ());
}
}
AccountState::AccountState(SLE::ref ledgerEntry, const RippleAddress& naAccountID) :
mAccountID(naAccountID), mLedgerEntry(ledgerEntry), mValid(false)
AccountState::AccountState (SLE::ref ledgerEntry, const RippleAddress& naAccountID) :
mAccountID (naAccountID), mLedgerEntry (ledgerEntry), mValid (false)
{
if (!mLedgerEntry)
return;
if (mLedgerEntry->getType() != ltACCOUNT_ROOT)
return;
if (!mLedgerEntry)
return;
mValid = true;
if (mLedgerEntry->getType () != ltACCOUNT_ROOT)
return;
mValid = true;
}
// VFALCO TODO Make this a generic utility function of some container class
//
std::string AccountState::createGravatarUrl(uint128 uEmailHash)
std::string AccountState::createGravatarUrl (uint128 uEmailHash)
{
Blob vucMD5(uEmailHash.begin(), uEmailHash.end());
std::string strMD5Lower = strHex(vucMD5);
boost::to_lower(strMD5Lower);
Blob vucMD5 (uEmailHash.begin (), uEmailHash.end ());
std::string strMD5Lower = strHex (vucMD5);
boost::to_lower (strMD5Lower);
// VFALCO TODO Give a name and move this constant to a more visible location.
// Also shouldn't this be https?
return str(boost::format("http://www.gravatar.com/avatar/%s") % strMD5Lower);
return str (boost::format ("http://www.gravatar.com/avatar/%s") % strMD5Lower);
}
void AccountState::addJson(Json::Value& val)
void AccountState::addJson (Json::Value& val)
{
val = mLedgerEntry->getJson(0);
val = mLedgerEntry->getJson (0);
if (mValid)
{
if (mLedgerEntry->isFieldPresent(sfEmailHash))
val["urlgravatar"] = createGravatarUrl(mLedgerEntry->getFieldH128(sfEmailHash));
}
else
{
val["Invalid"] = true;
}
if (mValid)
{
if (mLedgerEntry->isFieldPresent (sfEmailHash))
val["urlgravatar"] = createGravatarUrl (mLedgerEntry->getFieldH128 (sfEmailHash));
}
else
{
val["Invalid"] = true;
}
}
void AccountState::dump()
void AccountState::dump ()
{
Json::Value j(Json::objectValue);
addJson(j);
Log(lsINFO) << j;
Json::Value j (Json::objectValue);
addJson (j);
Log (lsINFO) << j;
}
// vim:ts=4