style: clang-format the entire project

This commit is contained in:
MatthewBeshay
2026-04-09 10:17:55 +10:00
parent 81c2eb82f0
commit cd4b39cf88
803 changed files with 6092 additions and 6095 deletions

View File

@@ -8,9 +8,9 @@
#include <system_error>
#include <vector>
#include "util/StringHelpers.h" // 4jcraft TODO
#include "platform/fs/fs.h"
#include "java/FileFilter.h"
#include "platform/fs/fs.h"
#include "util/StringHelpers.h" // 4jcraft TODO
const char File::pathSeparator = '/';
@@ -20,9 +20,7 @@ const std::string File::pathRoot =
namespace {
namespace fs = std::filesystem;
fs::path ToFilesystemPath(const std::string& path) {
return fs::path(path);
}
fs::path ToFilesystemPath(const std::string& path) { return fs::path(path); }
std::string ToFilename(const fs::path& path) {
const std::string filename = path.filename().string();

View File

@@ -28,10 +28,10 @@ ByteArrayInputStream::ByteArrayInputStream(std::vector<uint8_t>& buf)
this->buf = buf;
}
// 4jcraft: helper function to create a ByteArrayInputStream from a vector of bytes to avoid one copy
// 4jcraft: helper function to create a ByteArrayInputStream from a vector of
// bytes to avoid one copy
ByteArrayInputStream::ByteArrayInputStream(std::vector<uint8_t>&& buf)
: buf(std::move(buf)), pos(0), count(this->buf.size()), mark(0) {
}
: buf(std::move(buf)), pos(0), count(this->buf.size()), mark(0) {}
// Reads the next byte of data from this input stream. The value byte is
// returned as an int in the range 0 to 255. If no byte is available because the

View File

@@ -7,11 +7,10 @@
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <filesystem>
#include <string>
#include <vector>
#include <filesystem>
#include "java/File.h"
namespace {
@@ -53,7 +52,8 @@ FileInputStream::FileInputStream(const File& file) : m_fileHandle(nullptr) {
#if defined(_WIN32)
m_fileHandle = _wfopen(file.getPath().c_str(), "rb");
#else
const std::string nativePath = std::filesystem::path(file.getPath()).string();
const std::string nativePath =
std::filesystem::path(file.getPath()).string();
m_fileHandle = std::fopen(nativePath.c_str(), "rb");
#endif

View File

@@ -2,11 +2,10 @@
#include <cassert>
#include <cstdint>
#include <filesystem>
#include <string>
#include <vector>
#include <filesystem>
#include "java/File.h"
// Creates a file output stream to write to the file represented by the
@@ -30,7 +29,8 @@ FileOutputStream::FileOutputStream(const File& file) : m_fileHandle(nullptr) {
#if defined(_WIN32)
m_fileHandle = _wfopen(file.getPath().c_str(), "wb");
#else
const std::string nativePath = std::filesystem::path(file.getPath()).string();
const std::string nativePath =
std::filesystem::path(file.getPath()).string();
m_fileHandle = std::fopen(nativePath.c_str(), "wb");
#endif