mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-06 10:25:32 +00:00
style: clang-format the entire project
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user