Skip to content

Commit b3b2029

Browse files
committed
Fix format
1 parent 5f9a659 commit b3b2029

19 files changed

+65
-68
lines changed

core/config/project_settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
#include "core/input/input_map.h"
3535
#include "core/io/config_file.h"
3636
#include "core/io/dir_access.h"
37-
#include "core/io/filesystem.h"
3837
#include "core/io/file_access.h"
3938
#include "core/io/file_access_pack.h"
39+
#include "core/io/filesystem.h"
4040
#include "core/io/marshalls.h"
4141
#include "core/io/resource_uid.h"
4242
#include "core/object/script_language.h"
@@ -156,7 +156,7 @@ String ProjectSettings::localize_path(const String &p_path) const {
156156
}
157157

158158
// Check if we have a special path (like res://) or a protocol identifier.
159-
bool found=FileSystem::try_find_protocol_in_path(path,nullptr,nullptr);
159+
bool found = FileSystem::try_find_protocol_in_path(path, nullptr, nullptr);
160160
if (found) {
161161
return path;
162162
}

core/io/file_access_compressed.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ void FileAccessCompressed::store_buffer(const uint8_t *p_src, uint64_t p_length)
318318
write_pos += p_length;
319319
}
320320

321-
322321
void FileAccessCompressed::close() {
323322
_close();
324323
}

core/io/filesystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,4 @@ void FileSystem::_bind_methods() {
267267
ClassDB::bind_method(D_METHOD("set_hidden_attribute", "path", "hidden"), &FileSystem::set_hidden_attribute);
268268
ClassDB::bind_method(D_METHOD("get_read_only_attribute", "path"), &FileSystem::get_read_only_attribute);
269269
ClassDB::bind_method(D_METHOD("set_read_only_attribute", "path", "ro"), &FileSystem::set_read_only_attribute);
270-
}
270+
}

core/io/filesystem.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class FileSystem : public Object {
4646

4747
HashMap<String, Ref<FileSystemProtocol>> protocols;
4848

49-
5049
// for paths that doesn't have the protocol part, it fallsback to host://
5150
// if r_protocol returns null, the protocol of the path targeted is invalid.
5251
void process_path(const String &p_path, String *r_protocol_name, Ref<FileSystemProtocol> *r_protocol, String *r_file_path) const;
@@ -60,15 +59,15 @@ class FileSystem : public Object {
6059

6160
public:
6261
// out values are only valid when method returns true
63-
static bool try_find_protocol_in_path(const String& p_path,int* r_protocol_name_end,int* r_file_path_start);
62+
static bool try_find_protocol_in_path(const String &p_path, int *r_protocol_name_end, int *r_file_path_start);
6463
// returns whether it found a protocol present in the path
6564
static bool split_path(const String &p_path, String *r_protocol_name, String *r_file_path);
6665

6766
static String protocol_name_os;
6867
static String protocol_name_pipe;
6968
static String protocol_name_resources;
7069
static String protocol_name_user;
71-
static String protocol_name_memory;
70+
static String protocol_name_memory;
7271

7372
FileSystem();
7473
~FileSystem();
@@ -81,13 +80,13 @@ class FileSystem : public Object {
8180
Ref<FileSystemProtocol> get_protocol_or_null(const String &p_name) const;
8281

8382
// Basic path fix. Replaces FileAccess::fix_path.
84-
static String fix_path(const String& p_path);
83+
static String fix_path(const String &p_path);
8584

8685
Error get_open_error() const;
8786

88-
String globalize_path(const String& path) const;
87+
String globalize_path(const String &path) const;
8988

90-
Ref<FileAccess> open_file(const String &p_path, int p_mode_flags, Error *r_error=nullptr) const;
89+
Ref<FileAccess> open_file(const String &p_path, int p_mode_flags, Error *r_error = nullptr) const;
9190
bool file_exists(const String &p_path) const;
9291

9392
uint64_t get_modified_time(const String &p_path) const;
@@ -99,4 +98,4 @@ class FileSystem : public Object {
9998
Error set_read_only_attribute(const String &p_path, bool p_ro) const;
10099
};
101100

102-
#endif // FILESYSTEM_H
101+
#endif // FILESYSTEM_H

core/io/filesystem_protocol.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ Ref<FileAccess> FileSystemProtocol::_open_file(const String &p_path, int p_mode_
3737
return open_file(p_path, p_mode_flags, open_error);
3838
}
3939

40-
String FileSystemProtocol::globalize_path(const String& p_path) const {
40+
String FileSystemProtocol::globalize_path(const String &p_path) const {
4141
return p_path;
4242
}
4343

4444
void FileSystemProtocol::disguise_file(const Ref<FileAccess> &p_file, const String &p_protocol_name, const String &p_path) const {
45-
p_file->set_path_disguise(p_protocol_name+"://"+p_path);
45+
p_file->set_path_disguise(p_protocol_name + "://" + p_path);
4646
}
4747

48-
void FileSystemProtocol::_bind_methods(){
48+
void FileSystemProtocol::_bind_methods() {
4949
ClassDB::bind_method(D_METHOD("globalize_path", "path"), &FileSystemProtocol::globalize_path);
50-
50+
5151
ClassDB::bind_method(D_METHOD("get_open_error"), &FileSystemProtocol::get_open_error);
52-
ClassDB::bind_method(D_METHOD("open_file", "path","mode_flags"), &FileSystemProtocol::_open_file);
52+
ClassDB::bind_method(D_METHOD("open_file", "path", "mode_flags"), &FileSystemProtocol::_open_file);
5353
ClassDB::bind_method(D_METHOD("file_exists", "name"), &FileSystemProtocol::file_exists);
54-
54+
5555
ClassDB::bind_method(D_METHOD("get_modified_time", "path"), &FileSystemProtocol::get_modified_time);
5656
ClassDB::bind_method(D_METHOD("get_unix_permissions", "path"), &FileSystemProtocol::get_unix_permissions);
57-
ClassDB::bind_method(D_METHOD("set_unix_permissions", "path","permissions"), &FileSystemProtocol::set_unix_permissions);
57+
ClassDB::bind_method(D_METHOD("set_unix_permissions", "path", "permissions"), &FileSystemProtocol::set_unix_permissions);
5858
ClassDB::bind_method(D_METHOD("get_hidden_attribute", "path"), &FileSystemProtocol::get_hidden_attribute);
59-
ClassDB::bind_method(D_METHOD("set_hidden_attribute", "path","hidden"), &FileSystemProtocol::set_hidden_attribute);
59+
ClassDB::bind_method(D_METHOD("set_hidden_attribute", "path", "hidden"), &FileSystemProtocol::set_hidden_attribute);
6060
ClassDB::bind_method(D_METHOD("get_read_only_attribute", "path"), &FileSystemProtocol::get_read_only_attribute);
61-
ClassDB::bind_method(D_METHOD("set_read_only_attribute", "path","ro"), &FileSystemProtocol::set_read_only_attribute);
62-
}
61+
ClassDB::bind_method(D_METHOD("set_read_only_attribute", "path", "ro"), &FileSystemProtocol::set_read_only_attribute);
62+
}

core/io/filesystem_protocol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,4 @@ class FileSystemProtocol : public RefCounted {
6464
virtual Error set_read_only_attribute(const String &p_path, bool p_ro) const = 0;
6565
};
6666

67-
#endif // FILESYSTEM_PROTOCOL_H
67+
#endif // FILESYSTEM_PROTOCOL_H

core/io/filesystem_protocol_resources.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
#include "filesystem_protocol_resources.h"
3232
#include "core/config/project_settings.h"
33-
#include "core/io/filesystem.h"
3433
#include "core/io/file_access_pack.h"
34+
#include "core/io/filesystem.h"
3535
#include "core/os/os.h"
3636

3737
FileSystemProtocolResources::FileSystemProtocolResources() {}
@@ -69,7 +69,7 @@ bool FileSystemProtocolResources::file_exists(const String &p_path) const {
6969
// TODO: Replace this with resource mounting stack
7070

7171
//try packed data first
72-
if (PackedData::get_singleton() && !PackedData::get_singleton()->is_disabled() && PackedData::get_singleton()->has_path("res://"+p_path)) {
72+
if (PackedData::get_singleton() && !PackedData::get_singleton()->is_disabled() && PackedData::get_singleton()->has_path("res://" + p_path)) {
7373
return true;
7474
}
7575

@@ -81,15 +81,15 @@ uint64_t FileSystemProtocolResources::get_modified_time(const String &p_path) co
8181
if (PackedData::get_singleton() && !PackedData::get_singleton()->is_disabled() && (PackedData::get_singleton()->has_path(p_path) || PackedData::get_singleton()->has_directory(p_path))) {
8282
return 0;
8383
}
84-
84+
8585
String path = globalize_path(p_path);
8686
return protocol_os->get_modified_time(path);
8787
}
8888
BitField<FileAccess::UnixPermissionFlags> FileSystemProtocolResources::get_unix_permissions(const String &p_path) const {
8989
if (PackedData::get_singleton() && !PackedData::get_singleton()->is_disabled() && (PackedData::get_singleton()->has_path(p_path) || PackedData::get_singleton()->has_directory(p_path))) {
9090
return 0;
9191
}
92-
92+
9393
String path = globalize_path(p_path);
9494
return protocol_os->get_unix_permissions(path);
9595
}
@@ -129,7 +129,7 @@ Error FileSystemProtocolResources::set_read_only_attribute(const String &p_path,
129129
if (PackedData::get_singleton() && !PackedData::get_singleton()->is_disabled() && (PackedData::get_singleton()->has_path(p_path) || PackedData::get_singleton()->has_directory(p_path))) {
130130
return ERR_UNAVAILABLE;
131131
}
132-
132+
133133
String path = globalize_path(p_path);
134134
return protocol_os->set_read_only_attribute(path, p_ro);
135-
}
135+
}

core/io/filesystem_protocol_resources.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333

3434
#include "core/io/filesystem_protocol.h"
3535

36-
3736
class FileSystemProtocolResources : public FileSystemProtocol {
3837
GDCLASS(FileSystemProtocolResources, FileSystemProtocol);
3938

4039
private:
4140
Ref<FileSystemProtocol> protocol_os;
41+
4242
public:
4343
FileSystemProtocolResources();
44-
FileSystemProtocolResources(const Ref<FileSystemProtocol>& p_protocol_os);
44+
FileSystemProtocolResources(const Ref<FileSystemProtocol> &p_protocol_os);
4545

46-
void set_protocol_os(const Ref<FileSystemProtocol>& p_protocol_os);
46+
void set_protocol_os(const Ref<FileSystemProtocol> &p_protocol_os);
4747

48-
virtual String globalize_path(const String& p_path) const override;
48+
virtual String globalize_path(const String &p_path) const override;
4949

5050
virtual Ref<FileAccess> open_file(const String &p_path, int p_mode_flags, Error &r_error) const override;
5151
virtual bool file_exists(const String &p_path) const override;
@@ -59,4 +59,4 @@ class FileSystemProtocolResources : public FileSystemProtocol {
5959
virtual Error set_read_only_attribute(const String &p_path, bool p_ro) const override;
6060
};
6161

62-
#endif // FILESYSTEM_PROTOCOL_RESOURCES_H
62+
#endif // FILESYSTEM_PROTOCOL_RESOURCES_H

core/io/filesystem_protocol_user.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ bool FileSystemProtocolUser::get_read_only_attribute(const String &p_path) const
8484
Error FileSystemProtocolUser::set_read_only_attribute(const String &p_path, bool p_ro) const {
8585
String path = globalize_path(p_path);
8686
return protocol_os->set_read_only_attribute(path, p_ro);
87-
}
87+
}

core/io/filesystem_protocol_user.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@
3333

3434
#include "core/io/filesystem_protocol.h"
3535

36-
3736
class FileSystemProtocolUser : public FileSystemProtocol {
3837
GDCLASS(FileSystemProtocolUser, FileSystemProtocol);
3938

4039
private:
4140
Ref<FileSystemProtocol> protocol_os;
41+
4242
public:
4343
FileSystemProtocolUser();
44-
FileSystemProtocolUser(const Ref<FileSystemProtocol>& p_protocol_os);
44+
FileSystemProtocolUser(const Ref<FileSystemProtocol> &p_protocol_os);
4545

46-
void set_protocol_os(const Ref<FileSystemProtocol>& p_protocol_os);
46+
void set_protocol_os(const Ref<FileSystemProtocol> &p_protocol_os);
4747

48-
virtual String globalize_path(const String& p_path) const override;
48+
virtual String globalize_path(const String &p_path) const override;
4949

5050
virtual Ref<FileAccess> open_file(const String &p_path, int p_mode_flags, Error &r_error) const override;
5151
virtual bool file_exists(const String &p_path) const override;
@@ -59,4 +59,4 @@ class FileSystemProtocolUser : public FileSystemProtocol {
5959
virtual Error set_read_only_attribute(const String &p_path, bool p_ro) const override;
6060
};
6161

62-
#endif // FILESYSTEM_PROTOCOL_USER_H
62+
#endif // FILESYSTEM_PROTOCOL_USER_H

0 commit comments

Comments
 (0)