Skip to content

Commit

Permalink
Core: Move DirAccess and FileAccess to core/io
Browse files Browse the repository at this point in the history
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
  • Loading branch information
akien-mga committed Jun 11, 2021
1 parent 74b3b0d commit 9e328bb
Show file tree
Hide file tree
Showing 160 changed files with 183 additions and 183 deletions.
4 changes: 2 additions & 2 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
#include "core/core_bind.h"
#include "core/core_string_names.h"
#include "core/input/input_map.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/file_access_network.h"
#include "core/io/file_access_pack.h"
#include "core/io/marshalls.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/variant/variant_parser.h"
Expand Down
4 changes: 2 additions & 2 deletions core/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
#define CORE_BIND_H

#include "core/io/compression.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/image.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "core/os/semaphore.h"
#include "core/os/thread.h"
Expand Down
2 changes: 1 addition & 1 deletion core/io/config_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef CONFIG_FILE_H
#define CONFIG_FILE_H

#include "core/io/file_access.h"
#include "core/object/reference.h"
#include "core/os/file_access.h"
#include "core/templates/ordered_hash_map.h"
#include "core/variant/variant_parser.h"

Expand Down
2 changes: 1 addition & 1 deletion core/os/dir_access.cpp → core/io/dir_access.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "dir_access.h"

#include "core/config/project_settings.h"
#include "core/os/file_access.h"
#include "core/io/file_access.h"
#include "core/os/memory.h"
#include "core/os/os.h"

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion core/io/dtls_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "dtls_server.h"

#include "core/config/project_settings.h"
#include "core/os/file_access.h"
#include "core/io/file_access.h"

DTLSServer *(*DTLSServer::_create)() = nullptr;
bool DTLSServer::available = false;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion core/io/file_access_compressed.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define FILE_ACCESS_COMPRESSED_H

#include "core/io/compression.h"
#include "core/os/file_access.h"
#include "core/io/file_access.h"

class FileAccessCompressed : public FileAccess {
Compression::Mode cmode = Compression::MODE_ZSTD;
Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_encrypted.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef FILE_ACCESS_ENCRYPTED_H
#define FILE_ACCESS_ENCRYPTED_H

#include "core/os/file_access.h"
#include "core/io/file_access.h"

#define ENCRYPTED_HEADER_MAGIC 0x43454447

Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "file_access_memory.h"

#include "core/config/project_settings.h"
#include "core/os/dir_access.h"
#include "core/io/dir_access.h"
#include "core/templates/map.h"

static Map<String, Vector<uint8_t>> *files = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef FILE_ACCESS_MEMORY_H
#define FILE_ACCESS_MEMORY_H

#include "core/os/file_access.h"
#include "core/io/file_access.h"

class FileAccessMemory : public FileAccess {
uint8_t *data = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_network.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef FILE_ACCESS_NETWORK_H
#define FILE_ACCESS_NETWORK_H

#include "core/io/file_access.h"
#include "core/io/stream_peer_tcp.h"
#include "core/os/file_access.h"
#include "core/os/semaphore.h"
#include "core/os/thread.h"

Expand Down
4 changes: 2 additions & 2 deletions core/io/file_access_pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef FILE_ACCESS_PACK_H
#define FILE_ACCESS_PACK_H

#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/string/print_string.h"
#include "core/templates/list.h"
#include "core/templates/map.h"
Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_zip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include "file_access_zip.h"

#include "core/os/file_access.h"
#include "core/io/file_access.h"

ZipArchive *ZipArchive::instance = nullptr;

Expand Down
2 changes: 1 addition & 1 deletion core/io/image_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#ifndef IMAGE_LOADER_H
#define IMAGE_LOADER_H

#include "core/io/file_access.h"
#include "core/io/image.h"
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/string/ustring.h"
#include "core/templates/list.h"

Expand Down
2 changes: 1 addition & 1 deletion core/io/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "logger.h"

#include "core/config/project_settings.h"
#include "core/os/dir_access.h"
#include "core/io/dir_access.h"
#include "core/os/os.h"
#include "core/string/print_string.h"

Expand Down
2 changes: 1 addition & 1 deletion core/io/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef LOGGER_H
#define LOGGER_H

#include "core/os/file_access.h"
#include "core/io/file_access.h"
#include "core/string/ustring.h"
#include "core/templates/vector.h"

Expand Down
2 changes: 1 addition & 1 deletion core/io/packet_peer_dtls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "packet_peer_dtls.h"
#include "core/config/project_settings.h"
#include "core/os/file_access.h"
#include "core/io/file_access.h"

PacketPeerDTLS *(*PacketPeerDTLS::_create)() = nullptr;
bool PacketPeerDTLS::available = false;
Expand Down
2 changes: 1 addition & 1 deletion core/io/pck_packer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include "pck_packer.h"

#include "core/crypto/crypto_core.h"
#include "core/io/file_access.h"
#include "core/io/file_access_encrypted.h"
#include "core/io/file_access_pack.h" // PACK_HEADER_MAGIC, PACK_FORMAT_VERSION
#include "core/os/file_access.h"
#include "core/version.h"

static int _get_pad(int p_alignment, int p_n) {
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#include "resource.h"

#include "core/core_string_names.h"
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/object/script_language.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "scene/main/node.h" //only so casting works

Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_format_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#include "resource_format_binary.h"

#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/io/file_access_compressed.h"
#include "core/io/image.h"
#include "core/io/marshalls.h"
#include "core/os/dir_access.h"
#include "core/version.h"

//#define print_bl(m_what) print_line(m_what)
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_format_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#ifndef RESOURCE_FORMAT_BINARY_H
#define RESOURCE_FORMAT_BINARY_H

#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/os/file_access.h"

class ResourceLoaderBinary {
bool translation_remapped = false;
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "resource_loader.h"

#include "core/config/project_settings.h"
#include "core/io/file_access.h"
#include "core/io/resource_importer.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "core/string/print_string.h"
#include "core/string/translation.h"
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_saver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

#include "resource_saver.h"
#include "core/config/project_settings.h"
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/object/script_language.h"
#include "core/os/file_access.h"

Ref<ResourceFormatSaver> ResourceSaver::saver[MAX_SAVERS];

Expand Down
2 changes: 1 addition & 1 deletion core/io/translation_loader_po.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "translation_loader_po.h"

#include "core/os/file_access.h"
#include "core/io/file_access.h"
#include "core/string/translation.h"
#include "core/string/translation_po.h"

Expand Down
2 changes: 1 addition & 1 deletion core/io/translation_loader_po.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef TRANSLATION_LOADER_PO_H
#define TRANSLATION_LOADER_PO_H

#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/string/translation.h"

class TranslationLoaderPO : public ResourceFormatLoader {
Expand Down
2 changes: 1 addition & 1 deletion core/io/xml_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef XML_PARSER_H
#define XML_PARSER_H

#include "core/io/file_access.h"
#include "core/object/reference.h"
#include "core/os/file_access.h"
#include "core/string/ustring.h"
#include "core/templates/vector.h"

Expand Down
2 changes: 1 addition & 1 deletion core/io/zip_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef ZIP_IO_H
#define ZIP_IO_H

#include "core/os/file_access.h"
#include "core/io/file_access.h"

// Not directly used in this header, but assumed available in downstream users
// like platform/*/export/export.cpp. Could be fixed, but probably better to have
Expand Down
2 changes: 1 addition & 1 deletion core/math/delaunay_3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#ifndef DELAUNAY_3D_H
#define DELAUNAY_3D_H

#include "core/io/file_access.h"
#include "core/math/aabb.h"
#include "core/math/camera_matrix.h"
#include "core/math/vector3.h"
#include "core/os/file_access.h"
#include "core/string/print_string.h"
#include "core/templates/local_vector.h"
#include "core/templates/oa_hash_map.h"
Expand Down
4 changes: 2 additions & 2 deletions core/os/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/os/midi_driver.h"
#include "core/version_generated.gen.h"
#include "servers/audio_server.h"
Expand Down
2 changes: 1 addition & 1 deletion core/string/translation_po.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "translation_po.h"

#include "core/os/file_access.h"
#include "core/io/file_access.h"

#ifdef DEBUG_TRANSLATION_PO
void TranslationPO::print_translation_map() {
Expand Down
2 changes: 1 addition & 1 deletion core/variant/variant_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#ifndef VARIANT_PARSER_H
#define VARIANT_PARSER_H

#include "core/io/file_access.h"
#include "core/io/resource.h"
#include "core/os/file_access.h"
#include "core/variant/variant.h"

class VariantParser {
Expand Down
2 changes: 1 addition & 1 deletion drivers/png/resource_saver_png.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include "resource_saver_png.h"

#include "core/io/file_access.h"
#include "core/io/image.h"
#include "core/os/file_access.h"
#include "drivers/png/png_driver_common.h"
#include "scene/resources/texture.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/dir_access_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#if defined(UNIX_ENABLED) || defined(LIBC_FILEIO_ENABLED)

#include "core/os/dir_access.h"
#include "core/io/dir_access.h"

#include <dirent.h>
#include <sys/stat.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/unix/file_access_unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef FILE_ACCESS_UNIX_H
#define FILE_ACCESS_UNIX_H

#include "core/os/file_access.h"
#include "core/io/file_access.h"
#include "core/os/memory.h"

#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/vulkan/rendering_device_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "rendering_device_vulkan.h"

#include "core/config/project_settings.h"
#include "core/os/file_access.h"
#include "core/io/file_access.h"
#include "core/os/os.h"
#include "core/templates/hashfuncs.h"
#include "drivers/vulkan/vulkan_context.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/windows/dir_access_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#ifdef WINDOWS_ENABLED

#include "core/os/dir_access.h"
#include "core/io/dir_access.h"

/**
@author Juan Linietsky <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion drivers/windows/file_access_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#ifdef WINDOWS_ENABLED

#include "core/os/file_access.h"
#include "core/io/file_access.h"
#include "core/os/memory.h"

#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion editor/dependency_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

#include "dependency_editor.h"

#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "editor_node.h"
#include "editor_scale.h"
#include "scene/gui/margin_container.h"
Expand Down
2 changes: 1 addition & 1 deletion editor/doc_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include "core/config/project_settings.h"
#include "core/core_constants.h"
#include "core/io/compression.h"
#include "core/io/dir_access.h"
#include "core/io/marshalls.h"
#include "core/object/script_language.h"
#include "core/os/dir_access.h"
#include "core/version.h"
#include "scene/resources/theme.h"

Expand Down
4 changes: 2 additions & 2 deletions editor/editor_asset_installer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@

#include "editor_asset_installer.h"

#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/zip_io.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
#include "editor_node.h"
#include "progress_dialog.h"

Expand Down
Loading

0 comments on commit 9e328bb

Please sign in to comment.