Skip to content

Commit

Permalink
Updates for cbang API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoffland committed Mar 17, 2024
1 parent a8c8006 commit c1995a1
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/fah/client/Account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void Account::init() {
auto &db = app.getDB("config");

if (db.has("account"))
setData(JSON::Reader::parseString(db.getString("account")));
setData(JSON::Reader::parse(db.getString("account")));
}


Expand Down Expand Up @@ -246,7 +246,7 @@ void Account::onEncrypted(const JSON::ValuePtr &_msg) {
if (4e6 < ivs.size()) THROW("Too many IVs");

Cipher cipher("aes-256-cbc", false, sessionKey.data(), iv.data());
JSON::ValuePtr msg = JSON::Reader::parseString(cipher.crypt(payload));
JSON::ValuePtr msg = JSON::Reader::parse(cipher.crypt(payload));

LOG_DEBUG(5, *msg);

Expand Down
2 changes: 1 addition & 1 deletion src/fah/client/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void App::loadConfig() {

// Global config
auto &r = FAH::Client::resource0.get("global.json");
auto defaults = JSON::Reader::parseString(r.toString());
auto defaults = JSON::Reader::parse(InputSource(r));
SmartPointer<Config> config = new Config(*this, defaults);

config->load(getOptions());
Expand Down
2 changes: 1 addition & 1 deletion src/fah/client/GPUResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void GPUResources::update() {
bool fail = true;

try {
load(*JSON::Reader::parse(filename));
load(*JSON::Reader::parseFile(filename));
fail = false;
} CATCH_ERROR;

Expand Down
2 changes: 1 addition & 1 deletion src/fah/client/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Group::Group(App &app, const string &name) :
app(app), name(name),
event(app.getEventBase().newEvent(this, &Group::update, 0)) {
auto &r = FAH::Client::resource0.get("group.json");
auto defaults = JSON::Reader::parseString(r.toString());
auto defaults = JSON::Reader::parse(r);
config = new Config(app, defaults);
auto &db = app.getDB("groups");

Expand Down
6 changes: 3 additions & 3 deletions src/fah/client/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ void Unit::readViewerTop() {
string filename = getDirectory() + "/viewerTop.json";

if (existsAndOlderThan(filename, 10)) {
topology = JSON::Reader(filename).parse();
topology = JSON::Reader::parseFile(filename);
frames.clear();
}
}
Expand All @@ -714,7 +714,7 @@ bool Unit::readViewerFrame() {
getDirectory() + String::printf("/viewerFrame%d.json", viewerFrame);

if (existsAndOlderThan(filename, 10)) {
auto frame = JSON::Reader(filename).parse();
auto frame = JSON::Reader::parseFile(filename);

if (!frames.empty() && *frames.back() == *frame)
LOG_WARNING("Visualization frame " << viewerFrame
Expand Down Expand Up @@ -1062,7 +1062,7 @@ void Unit::downloadResponse(const JSON::ValuePtr &data) {
SystemUtilities::ensureDirectory(getDirectory());

auto f = SystemUtilities::oopen(getDirectory() + "/wudata_01.dat");
f->write(wuData.c_str(), wuData.length());
f->write(wuData.data(), wuData.length());
}

setState(UNIT_CORE);
Expand Down
2 changes: 1 addition & 1 deletion src/fah/client/Units.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Units::Units(App &app) {
app.getDB("units").foreach(
[this, &app, &clientID, &count] (const string &id, const string &data) {
try {
auto unit = SmartPtr(new Unit(app, JSON::Reader::parseString(data)));
auto unit = SmartPtr(new Unit(app, JSON::Reader::parse(data)));

if (unit->getClientID() == clientID) {add(unit); count++;}
else LOG_ERROR("WU with client ID " << unit->getClientID()
Expand Down

0 comments on commit c1995a1

Please sign in to comment.