Fixed a stoll bug that was there since day one, html parser, fix pkgconfig
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm:latest, arm-linux-gnueabihf, arm7, fw13-ubuntu-latest) (push) Failing after 38s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x64:latest, x86_64-linux-gnu, amd64, msi-walmart) (push) Failing after 41s
Build and Deploy on Tag / 🔨 Build for PowerPC (push) Failing after 43s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm64:latest, aarch64-linux-gnu, arm64, msi-walmart) (push) Failing after 42s
Build and Deploy on Tag / 🔨 Build win32 and update the tap 🍺 (push) Failing after 45s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x86:latest, i386-linux-gnu, 386, asrock) (push) Failing after 47s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-riscv64:latest, riscv64-linux-gnu, riscv64, asrock) (push) Failing after 1m0s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm:latest, arm-linux-gnueabihf, arm7, fw13-ubuntu-latest) (push) Failing after 38s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x64:latest, x86_64-linux-gnu, amd64, msi-walmart) (push) Failing after 41s
Build and Deploy on Tag / 🔨 Build for PowerPC (push) Failing after 43s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-arm64:latest, aarch64-linux-gnu, arm64, msi-walmart) (push) Failing after 42s
Build and Deploy on Tag / 🔨 Build win32 and update the tap 🍺 (push) Failing after 45s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-x86:latest, i386-linux-gnu, 386, asrock) (push) Failing after 47s
Build and Deploy on Tag / 🔨 Build for everything else (git.tesses.org/tesses50/linux-riscv64:latest, riscv64-linux-gnu, riscv64, asrock) (push) Failing after 1m0s
This commit is contained in:
@@ -284,4 +284,61 @@ void BitConverter::FromSint16LE(uint8_t &b, int16_t v) {
|
||||
memcpy(&dest, &v, sizeof(uint16_t));
|
||||
FromUint16LE(b, dest);
|
||||
}
|
||||
|
||||
bool BitConverter::TryParseSigned(const std::string &str, int64_t &val,
|
||||
int base) {
|
||||
try {
|
||||
if (str.find_first_not_of(" \t") != 0)
|
||||
return false;
|
||||
size_t pos = 0;
|
||||
int64_t v = std::stoll(str, &pos, base);
|
||||
if (pos < str.size())
|
||||
return false;
|
||||
val = v;
|
||||
return true;
|
||||
} catch (std::out_of_range &arg) {
|
||||
return false;
|
||||
} catch (std::invalid_argument &arg) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool BitConverter::TryParseUnsigned(const std::string &str, uint64_t &val,
|
||||
int base) {
|
||||
try {
|
||||
|
||||
if (str.find_first_not_of(" \t") != 0)
|
||||
return false;
|
||||
if (str[0] == '-' || str[0] == '+')
|
||||
return false;
|
||||
size_t pos = 0;
|
||||
uint64_t v = std::stoull(str, &pos, base);
|
||||
if (pos < str.size())
|
||||
return false;
|
||||
val = v;
|
||||
return true;
|
||||
} catch (std::out_of_range &arg) {
|
||||
return false;
|
||||
} catch (std::invalid_argument &arg) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool BitConverter::TryParseDouble(const std::string &str, double &val) {
|
||||
try {
|
||||
|
||||
if (str.find_first_not_of(" \t") != 0)
|
||||
return false;
|
||||
|
||||
size_t pos = 0;
|
||||
double v = std::stod(str, &pos);
|
||||
if (pos < str.size())
|
||||
return false;
|
||||
val = v;
|
||||
return true;
|
||||
} catch (std::out_of_range &arg) {
|
||||
return false;
|
||||
} catch (std::invalid_argument &arg) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Tesses::Framework::Serialization
|
||||
Reference in New Issue
Block a user