clean up libjava includes

This commit is contained in:
Tropical
2026-03-31 02:00:20 -05:00
parent bed181cd59
commit ea539a7e58
32 changed files with 100 additions and 30 deletions

View File

@@ -1,4 +1,5 @@
#include "java/Buffer.h"
#include <cassert>
Buffer::Buffer(unsigned int capacity)
: m_capacity(capacity),

View File

@@ -1,7 +1,15 @@
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include "java/IntBuffer.h"
#include "java/FloatBuffer.h"
#include "java/ByteBuffer.h"
#include "/home/tropical/Documents/GitHub/4jcraft/minecraft/Minecraft.World/ConsoleHelpers/Definitions.h"
#include "java/Buffer.h"
ByteBuffer::ByteBuffer(unsigned int capacity) : Buffer(capacity) {
hasBackingArray = false;

View File

@@ -1,9 +1,14 @@
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
#include <chrono>
#include <filesystem>
#include <string>
#include <system_error>
#include <vector>
#include "java/FileFilter.h"
#include "java/File.h"
#include "../../Minecraft.World/ConsoleHelpers/PathHelper.h" // 4jcraft TODO
#include "../../Minecraft.World/ConsoleHelpers/StringHelpers.h" // 4jcraft TODO

View File

@@ -1,5 +1,10 @@
#include "java/FloatBuffer.h"
#include <assert.h>
#include <string.h>
#include "java/Buffer.h"
// Allocates a new float buffer.
// The new buffer's position will be zero, its limit will be its capacity, and
// its mark will be undefined. It will have a backing array, and its array

View File

@@ -1,5 +1,9 @@
#include "java/InputOutputStream/BufferedOutputStream.h"
#include <stdio.h>
#include "java/InputOutputStream/OutputStream.h"
// Creates a new buffered output stream to write data to the specified
// underlying output stream with the specified buffer size. Parameters: out -
// the underlying output stream. size - the buffer size.

View File

@@ -1,5 +1,8 @@
#include "java/InputOutputStream/BufferedReader.h"
#include <cstring>
#include <cassert>
// Creates a buffering character-input stream that uses a default-sized input
// buffer. Parameters: in - A Reader
BufferedReader::BufferedReader(Reader* in)

View File

@@ -1,4 +1,3 @@
#include "java/InputOutputStream/InputOutputStream.h"
// Creates ByteArrayInputStream that uses buf as its buffer array. The initial
// value of pos is offset and the initial value of count is the minimum of
@@ -6,6 +5,13 @@
// mark is set to the specified offset. Parameters: buf - the input buffer.
// offset - the offset in the buffer of the first byte to read.
// length - the maximum number of bytes to read from the buffer.
#include <stdint.h>
#include <algorithm>
#include <cstring>
#include <vector>
#include "java/InputOutputStream/ByteArrayInputStream.h"
ByteArrayInputStream::ByteArrayInputStream(std::vector<uint8_t>& buf, unsigned int offset,
unsigned int length)
: pos(offset), count(std::min(offset + length, (unsigned int)buf.size())), mark(offset) {

View File

@@ -1,5 +1,9 @@
#include "java/InputOutputStream/ByteArrayOutputStream.h"
#include <assert.h>
#include <algorithm>
#include <cstring>
// Creates a new byte array output stream. The buffer capacity is initially 32
// bytes, though its size increases if necessary.
ByteArrayOutputStream::ByteArrayOutputStream() {

View File

@@ -1,7 +1,11 @@
#include <stdio.h>
#include <bit>
#include <cstdint>
#include <string>
#include <vector>
#include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/InputStream.h"
// Creates a DataInputStream that uses the specified underlying InputStream.
// Parameters:

View File

@@ -1,7 +1,11 @@
#include <stdio.h>
#include <bit>
#include <cstdint>
#include <string>
#include <vector>
#include "java/InputOutputStream/DataOutputStream.h"
#include "java/InputOutputStream/OutputStream.h"
// Creates a new data output stream to write data to the specified underlying
// output stream. The counter written is set to zero. Parameters: out - the

View File

@@ -1,8 +1,14 @@
#include <assert.h>
#include <sys/types.h>
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <string>
#include <vector>
#include "java/File.h"
#include "java/InputOutputStream/FileInputStream.h"
#include <algorithm>
#include "../../../Minecraft.World/ConsoleHelpers/StringHelpers.h"
namespace {

View File

@@ -1,6 +1,8 @@
#include <string>
#include "java/File.h"
#include "java/InputOutputStream/InputOutputStream.h"
#include "java/InputOutputStream/InputStream.h"
#include "java/InputOutputStream/FileInputStream.h"
InputStream* InputStream::getResourceAsStream(const std::wstring& fileName) {
File file(fileName);

View File

@@ -1,7 +1,8 @@
#include "java/InputOutputStream/InputStream.h"
#include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/InputStreamReader.h"
class InputStream;
// Creates an InputStreamReader that uses the default charset.
// Parameters:
// in - An InputStream

View File

@@ -1,5 +1,11 @@
#include "java/IntBuffer.h"
#include <assert.h>
#include <string.h>
#include <algorithm>
#include "java/Buffer.h"
// Allocates a new int buffer.
// The new buffer's position will be zero, its limit will be its capacity, and
// its mark will be undefined. It will have a backing array, and its array

View File

@@ -1,11 +1,19 @@
#if defined(__linux__)
#include <sys/time.h>
#include <time.h>
#include <ctime>
#endif
#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <algorithm>
#include <vector>
#include "java/System.h"
class Biome;
class Node;
template <class T>
void System::arraycopy(const std::vector<T>& src, unsigned int srcPos,
std::vector<T>* dst, unsigned int dstPos,