CHECK_EXIST(args, "offset", out)
const std::string& location = args.get("location").get<std::string>();
- size_t offset = static_cast<size_t>(args.get("offset").get<double>());
+ long offset = static_cast<long>(args.get("offset").get<double>());
size_t length = args.contains("length") ? (size_t)args.get("length").get<double>() : NPOS;
const std::string& encoding =
args.contains("encoding") ? args.get("encoding").get<std::string>() : "utf-8";
CHECK_EXIST(args, "length", out)
const std::string& location = args.get("location").get<std::string>();
- size_t offset = static_cast<size_t>(args.get("offset").get<double>());
+ long offset = static_cast<long>(args.get("offset").get<double>());
size_t length = static_cast<size_t>(args.get("length").get<double>());
try {
const std::string& location = args.get("location").get<std::string>();
const std::string& str = args.get("data").get<std::string>();
- size_t offset = static_cast<size_t>(args.get("offset").get<double>());
+ long offset = static_cast<long>(args.get("offset").get<double>());
bool truncate = static_cast<bool>(args.get("truncate").get<bool>());
const char* mode = truncate ? "w" : "r+";
const std::string& encoding =
const std::string& location = args.get("location").get<std::string>();
const std::string& str = args.get("data").get<std::string>();
- size_t offset = static_cast<size_t>(args.get("offset").get<double>());
+ long offset = static_cast<long>(args.get("offset").get<double>());
bool truncate = static_cast<bool>(args.get("truncate").get<bool>());
const char* mode = truncate ? "w" : "r+";
const std::string& location = args.get("location").get<std::string>();
const std::string& str = args.get("data").get<std::string>();
- size_t offset = static_cast<size_t>(args.get("offset").get<double>());
+ long offset = static_cast<long>(args.get("offset").get<double>());
bool truncate = static_cast<bool>(args.get("truncate").get<bool>());
const char* mode = truncate ? "w" : "r+";
auto logic = [handle, count, encoding, whole_file](decltype(out) out) {
try {
size_t read_bytes = 0;
- std::vector<std::uint8_t> buf = read_file(handle->file_handle, count, &read_bytes);
+ std::vector<std::uint8_t> buf = read_file(handle->file_handle, static_cast<long>(count), &read_bytes);
buf.resize(read_bytes); // this protects from reporting too big arrays to JS
if (encoding == kISOEncoding) { // for iso-8859-1 1 byte is equal to 1 character
out["result"] = picojson::value(picojson::string_type, true);