Merge lp:~widelands-dev/widelands/bug-1343299 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 7190
Proposed branch: lp:~widelands-dev/widelands/bug-1343299
Merge into: lp:widelands
Diff against target: 25952 lines (+4801/-4801)
306 files modified
src/ai/ai_help_structs.cc (+1/-1)
src/ai/ai_help_structs.h (+1/-1)
src/ai/computer_player.cc (+3/-3)
src/ai/computer_player.h (+3/-3)
src/ai/defaultai.cc (+15/-15)
src/base/md5.h (+6/-6)
src/chat/chat.h (+2/-2)
src/economy/cmd_call_economy_balance.cc (+16/-16)
src/economy/cmd_call_economy_balance.h (+2/-2)
src/economy/economy.cc (+7/-7)
src/economy/economy_data_packet.cc (+17/-17)
src/economy/economy_data_packet.h (+2/-2)
src/economy/fleet.cc (+16/-16)
src/economy/portdock.cc (+17/-17)
src/economy/request.cc (+32/-32)
src/economy/request.h (+2/-2)
src/economy/road.cc (+2/-2)
src/economy/road.h (+1/-1)
src/economy/route.cc (+7/-7)
src/economy/route.h (+1/-1)
src/economy/shippingitem.cc (+4/-4)
src/economy/transfer.cc (+5/-5)
src/economy/ware_instance.cc (+14/-14)
src/economy/wares_queue.cc (+20/-20)
src/economy/wares_queue.h (+2/-2)
src/editor/editorinteractive.cc (+1/-1)
src/editor/map_generator.cc (+40/-40)
src/editor/map_generator.h (+5/-5)
src/editor/tools/editor_decrease_resources_tool.cc (+1/-1)
src/editor/tools/editor_increase_resources_tool.cc (+2/-2)
src/editor/tools/editor_increase_resources_tool.h (+1/-1)
src/editor/tools/editor_make_infrastructure_tool.cc (+1/-1)
src/editor/tools/editor_make_infrastructure_tool.h (+1/-1)
src/editor/tools/editor_set_port_space_tool.cc (+3/-3)
src/editor/tools/editor_set_port_space_tool.h (+1/-1)
src/editor/tools/editor_set_resources_tool.cc (+1/-1)
src/editor/tools/editor_set_starting_pos_tool.cc (+2/-2)
src/editor/tools/editor_set_starting_pos_tool.h (+1/-1)
src/editor/ui_menus/editor_main_menu_load_map.cc (+8/-8)
src/editor/ui_menus/editor_main_menu_map_options.cc (+2/-2)
src/editor/ui_menus/editor_main_menu_random_map.cc (+6/-6)
src/editor/ui_menus/editor_main_menu_save_map.cc (+20/-20)
src/editor/ui_menus/editor_main_menu_save_map_make_directory.cc (+1/-1)
src/editor/ui_menus/editor_player_menu.cc (+5/-5)
src/editor/ui_menus/editor_tool_change_resources_options_menu.cc (+1/-1)
src/editor/ui_menus/editor_tool_menu.cc (+1/-1)
src/game_io/game_class_packet.cc (+10/-10)
src/game_io/game_class_packet.h (+2/-2)
src/game_io/game_cmd_queue_packet.cc (+21/-21)
src/game_io/game_cmd_queue_packet.h (+2/-2)
src/game_io/game_data_packet.h (+2/-2)
src/game_io/game_interactive_player_packet.cc (+14/-14)
src/game_io/game_interactive_player_packet.h (+2/-2)
src/game_io/game_loader.cc (+12/-12)
src/game_io/game_map_packet.cc (+6/-6)
src/game_io/game_map_packet.h (+5/-5)
src/game_io/game_player_economies_packet.cc (+15/-15)
src/game_io/game_player_economies_packet.h (+2/-2)
src/game_io/game_player_info_packet.cc (+50/-50)
src/game_io/game_player_info_packet.h (+2/-2)
src/game_io/game_preload_packet.cc (+5/-5)
src/game_io/game_preload_packet.h (+2/-2)
src/game_io/game_saver.cc (+8/-8)
src/graphic/animation.cc (+3/-3)
src/graphic/diranimations.h (+1/-1)
src/graphic/font.cc (+2/-2)
src/graphic/graphic.cc (+3/-3)
src/graphic/image_io.cc (+6/-6)
src/graphic/render/gamerenderer_gl.cc (+2/-2)
src/graphic/render/gl_surface_texture.cc (+2/-2)
src/graphic/render/gl_surface_texture.h (+3/-3)
src/graphic/text/font_io.cc (+2/-2)
src/graphic/text/test/render.cc (+2/-2)
src/graphic/text/test/render_richtext.cc (+2/-2)
src/graphic/texture.cc (+1/-1)
src/graphic/texture.h (+1/-1)
src/io/dedicated_log.cc (+19/-19)
src/io/dedicated_log.h (+1/-1)
src/io/fileread.cc (+20/-20)
src/io/fileread.h (+17/-17)
src/io/filesystem/disk_filesystem.cc (+60/-60)
src/io/filesystem/disk_filesystem.h (+26/-26)
src/io/filesystem/filesystem.cc (+27/-27)
src/io/filesystem/filesystem.h (+31/-31)
src/io/filesystem/layered_filesystem.cc (+72/-71)
src/io/filesystem/layered_filesystem.h (+26/-26)
src/io/filesystem/test/test_filesystem.cc (+7/-7)
src/io/filesystem/zip_exceptions.h (+1/-1)
src/io/filesystem/zip_filesystem.cc (+64/-64)
src/io/filesystem/zip_filesystem.h (+34/-34)
src/io/filewrite.cc (+19/-19)
src/io/filewrite.h (+12/-12)
src/io/machdep.h (+13/-13)
src/io/streamread.cc (+20/-20)
src/io/streamread.h (+15/-15)
src/io/streamwrite.cc (+4/-4)
src/io/streamwrite.h (+29/-29)
src/logic/attackable.h (+1/-1)
src/logic/battle.cc (+32/-32)
src/logic/battle.h (+2/-2)
src/logic/bob.cc (+65/-65)
src/logic/bob.h (+2/-2)
src/logic/buildcost.cc (+6/-6)
src/logic/building.cc (+1/-1)
src/logic/campaign_visibility.cc (+2/-2)
src/logic/carrier.cc (+5/-5)
src/logic/checkstep.cc (+9/-9)
src/logic/checkstep.h (+11/-11)
src/logic/cmd_calculate_statistics.cc (+6/-6)
src/logic/cmd_calculate_statistics.h (+2/-2)
src/logic/cmd_incorporate.cc (+8/-8)
src/logic/cmd_incorporate.h (+2/-2)
src/logic/cmd_luacoroutine.cc (+7/-7)
src/logic/cmd_luacoroutine.h (+2/-2)
src/logic/cmd_luascript.cc (+8/-8)
src/logic/cmd_luascript.h (+2/-2)
src/logic/cmd_queue.cc (+9/-9)
src/logic/cmd_queue.h (+2/-2)
src/logic/critter.cc (+7/-7)
src/logic/editor_game_base.cc (+1/-1)
src/logic/editor_game_base.h (+1/-1)
src/logic/expedition_bootstrap.cc (+12/-12)
src/logic/findbob.cc (+1/-1)
src/logic/findimmovable.cc (+1/-1)
src/logic/game.cc (+54/-54)
src/logic/game.h (+9/-9)
src/logic/game_controller.h (+10/-10)
src/logic/game_settings.h (+29/-29)
src/logic/immovable.cc (+40/-40)
src/logic/instances.cc (+28/-28)
src/logic/instances.h (+4/-4)
src/logic/map.cc (+4/-4)
src/logic/map.h (+4/-4)
src/logic/map_info.cc (+8/-8)
src/logic/message.h (+2/-2)
src/logic/message_id.h (+2/-2)
src/logic/message_queue.h (+1/-1)
src/logic/militarysite.cc (+48/-48)
src/logic/militarysite.h (+14/-14)
src/logic/path.cc (+9/-9)
src/logic/path.h (+1/-1)
src/logic/pathfield.cc (+1/-1)
src/logic/pathfield.h (+1/-1)
src/logic/player.cc (+48/-48)
src/logic/player.h (+7/-7)
src/logic/playercommand.cc (+483/-483)
src/logic/playercommand.h (+60/-60)
src/logic/playersmanager.cc (+3/-3)
src/logic/production_program.cc (+4/-4)
src/logic/productionsite.h (+1/-1)
src/logic/replay.cc (+33/-33)
src/logic/replay.h (+4/-4)
src/logic/replay_game_controller.cc (+12/-12)
src/logic/replay_game_controller.h (+8/-8)
src/logic/requirements.cc (+27/-27)
src/logic/requirements.h (+4/-4)
src/logic/save_handler.cc (+12/-12)
src/logic/ship.cc (+31/-31)
src/logic/single_player_game_controller.cc (+11/-11)
src/logic/single_player_game_controller.h (+8/-8)
src/logic/single_player_game_settings_provider.cc (+43/-43)
src/logic/single_player_game_settings_provider.h (+23/-23)
src/logic/soldier.cc (+54/-54)
src/logic/soldier.h (+7/-7)
src/logic/soldiercontrol.h (+13/-13)
src/logic/trainingsite.cc (+29/-29)
src/logic/trainingsite.h (+11/-11)
src/logic/tribe.cc (+5/-5)
src/logic/warehouse.cc (+14/-14)
src/logic/warehouse.h (+16/-16)
src/logic/widelands.h (+3/-3)
src/logic/widelands_geometry.cc (+2/-2)
src/logic/widelands_geometry.h (+1/-1)
src/logic/widelands_geometry_io.cc (+28/-28)
src/logic/widelands_geometry_io.h (+12/-12)
src/logic/worker.cc (+18/-18)
src/logic/worker.h (+1/-1)
src/logic/worker_descr.cc (+3/-3)
src/logic/worker_descr.h (+1/-1)
src/logic/worker_program.cc (+3/-3)
src/logic/worker_program.h (+1/-1)
src/logic/world/editor_category.cc (+1/-1)
src/logic/world/map_gen.cc (+32/-32)
src/logic/world/map_gen.h (+26/-26)
src/logic/world/terrain_description.cc (+2/-2)
src/map_io/map_allowed_building_types_packet.cc (+2/-2)
src/map_io/map_allowed_worker_types_packet.cc (+2/-2)
src/map_io/map_bob_packet.cc (+10/-10)
src/map_io/map_bob_packet.h (+2/-2)
src/map_io/map_building_packet.cc (+31/-31)
src/map_io/map_building_packet.h (+2/-2)
src/map_io/map_buildingdata_packet.cc (+261/-261)
src/map_io/map_buildingdata_packet.h (+2/-2)
src/map_io/map_data_packet.h (+2/-2)
src/map_io/map_elemental_packet.cc (+4/-4)
src/map_io/map_elemental_packet.h (+3/-3)
src/map_io/map_exploration_packet.cc (+12/-12)
src/map_io/map_extradata_packet.cc (+13/-13)
src/map_io/map_extradata_packet.h (+2/-2)
src/map_io/map_flag_packet.cc (+13/-13)
src/map_io/map_flagdata_packet.cc (+47/-47)
src/map_io/map_heights_packet.cc (+8/-8)
src/map_io/map_message_saver.h (+1/-1)
src/map_io/map_node_ownership_packet.cc (+9/-9)
src/map_io/map_object_packet.cc (+9/-9)
src/map_io/map_object_packet.h (+3/-3)
src/map_io/map_objective_packet.cc (+2/-2)
src/map_io/map_player_names_and_tribes_packet.cc (+4/-4)
src/map_io/map_player_names_and_tribes_packet.h (+3/-3)
src/map_io/map_player_position_packet.cc (+2/-2)
src/map_io/map_players_messages_packet.cc (+5/-5)
src/map_io/map_players_view_packet.cc (+131/-131)
src/map_io/map_port_spaces_packet.cc (+2/-2)
src/map_io/map_port_spaces_packet.h (+3/-3)
src/map_io/map_resources_packet.cc (+18/-18)
src/map_io/map_resources_packet.h (+2/-2)
src/map_io/map_road_packet.cc (+9/-9)
src/map_io/map_roaddata_packet.cc (+55/-55)
src/map_io/map_saver.cc (+25/-25)
src/map_io/map_scripting_packet.cc (+17/-17)
src/map_io/map_terrain_packet.cc (+17/-17)
src/map_io/map_terrain_packet.h (+2/-2)
src/map_io/map_version_packet.cc (+2/-2)
src/map_io/s2map.cc (+14/-14)
src/map_io/widelands_map_loader.cc (+32/-32)
src/network/internet_gaming.cc (+100/-100)
src/network/internet_gaming.h (+7/-7)
src/network/internet_gaming_protocol.h (+41/-41)
src/network/netclient.cc (+206/-206)
src/network/netclient.h (+37/-37)
src/network/nethost.cc (+477/-477)
src/network/nethost.h (+60/-60)
src/network/network.cc (+6/-6)
src/network/network.h (+5/-5)
src/network/network_lan_promotion.cc (+3/-3)
src/network/network_lan_promotion.h (+1/-1)
src/network/network_player_settings_backend.cc (+7/-7)
src/network/network_protocol.h (+50/-50)
src/profile/profile.cc (+10/-10)
src/profile/profile.h (+2/-2)
src/random/random.cc (+8/-8)
src/random/random.h (+2/-2)
src/scripting/lua_coroutine.cc (+8/-8)
src/scripting/lua_game.cc (+8/-8)
src/scripting/lua_map.cc (+7/-7)
src/scripting/lua_path.cc (+4/-4)
src/scripting/lua_root.cc (+2/-2)
src/scripting/lua_ui.cc (+2/-2)
src/scripting/persistence.cc (+5/-5)
src/scripting/scripting.cc (+2/-2)
src/scripting/test/test_luna.cc (+9/-9)
src/sound/songset.cc (+5/-5)
src/sound/sound_handler.cc (+10/-10)
src/sound/sound_handler.h (+0/-1)
src/ui_basic/editbox.cc (+4/-4)
src/ui_basic/editbox.h (+4/-4)
src/ui_basic/helpwindow.cc (+3/-3)
src/ui_basic/helpwindow.h (+1/-1)
src/ui_basic/icon.cc (+3/-3)
src/ui_basic/icon.h (+3/-3)
src/ui_basic/messagebox.cc (+12/-12)
src/ui_basic/messagebox.h (+3/-3)
src/ui_basic/panel.cc (+1/-1)
src/ui_basic/progresswindow.cc (+1/-1)
src/ui_basic/spinbox.cc (+17/-17)
src/ui_basic/spinbox.h (+8/-8)
src/ui_fsmenu/editor_mapselect.cc (+8/-8)
src/ui_fsmenu/internet_lobby.cc (+12/-12)
src/ui_fsmenu/internet_lobby.h (+4/-4)
src/ui_fsmenu/launch_mpg.cc (+34/-34)
src/ui_fsmenu/launch_mpg.h (+1/-1)
src/ui_fsmenu/launch_spg.cc (+20/-20)
src/ui_fsmenu/loadgame.cc (+11/-11)
src/ui_fsmenu/loadreplay.cc (+5/-5)
src/ui_fsmenu/mapselect.cc (+5/-5)
src/ui_fsmenu/multiplayer.cc (+5/-5)
src/ui_fsmenu/multiplayer.h (+2/-2)
src/ui_fsmenu/netsetup_lan.cc (+3/-3)
src/ui_fsmenu/options.cc (+12/-12)
src/wlapplication.cc (+23/-23)
src/wui/attack_box.cc (+1/-1)
src/wui/chatoverlay.cc (+6/-6)
src/wui/chatoverlay.h (+1/-1)
src/wui/debugconsole.cc (+2/-2)
src/wui/debugconsole.h (+2/-2)
src/wui/encyclopedia_window.cc (+6/-6)
src/wui/encyclopedia_window.h (+3/-3)
src/wui/fieldaction.cc (+13/-13)
src/wui/game_chat_menu.cc (+1/-1)
src/wui/game_debug_ui.cc (+2/-2)
src/wui/game_main_menu_save_game.cc (+14/-14)
src/wui/gamechatpanel.cc (+9/-9)
src/wui/gamechatpanel.h (+4/-4)
src/wui/interactive_base.cc (+19/-19)
src/wui/interactive_base.h (+2/-2)
src/wui/interactive_gamebase.cc (+1/-1)
src/wui/interactive_player.cc (+4/-4)
src/wui/itemwaresdisplay.cc (+8/-8)
src/wui/itemwaresdisplay.h (+3/-3)
src/wui/login_box.cc (+6/-6)
src/wui/login_box.h (+2/-2)
src/wui/multiplayersetupgroup.cc (+9/-9)
src/wui/playerdescrgroup.cc (+10/-10)
src/wui/soldiercapacitycontrol.cc (+3/-3)
src/wui/soldierlist.cc (+7/-7)
src/wui/waresdisplay.cc (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1343299
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+236329@code.launchpad.net

Description of the change

Refactoring: removed CamelCase etc from function names.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

Awesome! Code base is getting in ever better shape. Now formatting is the biggest remaining issue that needs solving.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ai/ai_help_structs.cc'
2--- src/ai/ai_help_structs.cc 2014-07-20 07:47:15 +0000
3+++ src/ai/ai_help_structs.cc 2014-09-29 14:39:47 +0000
4@@ -60,7 +60,7 @@
5 return true;
6 }
7
8-bool CheckStepRoadAI::reachabledest(Map& map, FCoords const dest) const {
9+bool CheckStepRoadAI::reachable_dest(Map& map, FCoords const dest) const {
10 NodeCaps const caps = dest.field->nodecaps();
11
12 if (!(caps & movecaps_)) {
13
14=== modified file 'src/ai/ai_help_structs.h'
15--- src/ai/ai_help_structs.h 2014-09-10 08:55:04 +0000
16+++ src/ai/ai_help_structs.h 2014-09-29 14:39:47 +0000
17@@ -48,7 +48,7 @@
18 }
19
20 bool allowed(Map&, FCoords start, FCoords end, int32_t dir, CheckStep::StepId) const;
21- bool reachabledest(Map&, FCoords dest) const;
22+ bool reachable_dest(Map&, FCoords dest) const;
23
24 Player* player_;
25 uint8_t movecaps_;
26
27=== modified file 'src/ai/computer_player.cc'
28--- src/ai/computer_player.cc 2014-09-10 13:03:40 +0000
29+++ src/ai/computer_player.cc 2014-09-29 14:39:47 +0000
30@@ -50,7 +50,7 @@
31 EmptyAI::EmptyAIImpl EmptyAI::implementation;
32
33 const ComputerPlayer::ImplementationVector &
34-ComputerPlayer::getImplementations()
35+ComputerPlayer::get_implementations()
36 {
37 static std::vector<ComputerPlayer::Implementation const *> impls;
38
39@@ -64,10 +64,10 @@
40 return impls;
41 }
42
43-const ComputerPlayer::Implementation * ComputerPlayer::getImplementation
44+const ComputerPlayer::Implementation * ComputerPlayer::get_implementation
45 (const std::string & name)
46 {
47- const ImplementationVector & vec = getImplementations();
48+ const ImplementationVector & vec = get_implementations();
49
50 for (const ComputerPlayer::Implementation* implementation : vec) {
51 if (implementation->name == name) {
52
53=== modified file 'src/ai/computer_player.h'
54--- src/ai/computer_player.h 2014-09-14 11:31:58 +0000
55+++ src/ai/computer_player.h 2014-09-29 14:39:47 +0000
56@@ -48,7 +48,7 @@
57 /**
58 * Interface to a concrete implementation, used to instantiate AIs.
59 *
60- * \see getImplementations()
61+ * \see get_implementations()
62 */
63 struct Implementation {
64 std::string name;
65@@ -61,12 +61,12 @@
66 /**
67 * Get a list of available AI implementations.
68 */
69- static const ImplementationVector & getImplementations();
70+ static const ImplementationVector & get_implementations();
71
72 /**
73 * Get the best matching implementation for this name.
74 */
75- static const Implementation * getImplementation(const std::string & name);
76+ static const Implementation * get_implementation(const std::string & name);
77
78 private:
79 Widelands::Game & m_game;
80
81=== modified file 'src/ai/defaultai.cc'
82--- src/ai/defaultai.cc 2014-09-14 11:31:58 +0000
83+++ src/ai/defaultai.cc 2014-09-29 14:39:47 +0000
84@@ -658,10 +658,10 @@
85
86 if (v > 0 && dist > 0) {
87
88- field.military_capacity_ += militarysite->maxSoldierCapacity();
89- field.military_presence_ += militarysite->stationedSoldiers().size();
90+ field.military_capacity_ += militarysite->max_soldier_capacity();
91+ field.military_presence_ += militarysite->stationed_soldiers().size();
92
93- if (!militarysite->stationedSoldiers().empty()) {
94+ if (!militarysite->stationed_soldiers().empty()) {
95 field.military_stationed_ += 1;
96 }
97
98@@ -2216,7 +2216,7 @@
99 for (std::list<MilitarySiteObserver>::iterator it = militarysites.begin();
100 it != militarysites.end();
101 ++it)
102- if (it->site->stationedSoldiers().size() == 0)
103+ if (it->site->stationed_soldiers().size() == 0)
104 unstationed_milit_buildings_ += 1;
105
106 // count militarysites in construction
107@@ -2250,7 +2250,7 @@
108 // as long as it is > 1 - BUT take care that there is a warehouse in the
109 // same economy where the thrown out soldiers can go to.
110 if (ms->economy().warehouses().size()) {
111- uint32_t const j = ms->soldierCapacity();
112+ uint32_t const j = ms->soldier_capacity();
113
114 if (MilitarySite::kPrefersRookies != ms->get_soldier_preference()) {
115 game().send_player_militarysite_set_soldier_preference(
116@@ -2283,8 +2283,8 @@
117 } else {
118 // If an enemy is in sight and the number of stationed soldier is not
119 // at maximum - set it to maximum.
120- uint32_t const j = ms->maxSoldierCapacity();
121- uint32_t const k = ms->soldierCapacity();
122+ uint32_t const j = ms->max_soldier_capacity();
123+ uint32_t const k = ms->soldier_capacity();
124
125 if (j > k)
126 // game().send_player_change_soldier_capacity(*ms, j - k);
127@@ -2696,11 +2696,11 @@
128 continue;
129 }
130
131- if (bld->canAttack()) {
132+ if (bld->can_attack()) {
133
134 // any_attackable_building=true;
135
136- int32_t ta = player_->findAttackSoldiers(bld->base_flag());
137+ int32_t ta = player_->find_attack_soldiers(bld->base_flag());
138
139 if (type_ == NORMAL)
140 ta = ta * 2 / 3;
141@@ -2708,24 +2708,24 @@
142 if (ta < 1)
143 continue;
144
145- int32_t const tc = ta - bld->presentSoldiers().size();
146+ int32_t const tc = ta - bld->present_soldiers().size();
147
148- if (bld->presentSoldiers().size() > 1)
149- defend_ready_enemies += bld->presentSoldiers().size() - 1;
150+ if (bld->present_soldiers().size() > 1)
151+ defend_ready_enemies += bld->present_soldiers().size() - 1;
152
153 if (tc > chance) {
154 target = bld;
155 chance = tc;
156 attackers = ta;
157- defenders = bld->presentSoldiers().size();
158+ defenders = bld->present_soldiers().size();
159 }
160 }
161 } else if (upcast(Warehouse, wh, immovables.at(j).object)) {
162 if (!player_->is_hostile(wh->owner()))
163 continue;
164
165- if (wh->canAttack()) {
166- int32_t ta = player_->findAttackSoldiers(wh->base_flag());
167+ if (wh->can_attack()) {
168+ int32_t ta = player_->find_attack_soldiers(wh->base_flag());
169
170 if (ta < 1)
171 continue;
172
173=== modified file 'src/base/md5.h'
174--- src/base/md5.h 2014-09-14 11:31:58 +0000
175+++ src/base/md5.h 2014-09-29 14:39:47 +0000
176@@ -65,8 +65,8 @@
177 /**
178 * This class is responsible for creating a streaming md5 checksum.
179 * You simply pass it the data using stream operations, and if you want
180- * to read the checksum, first call FinishChecksum(), followed by
181- * GetChecksum().
182+ * to read the checksum, first call finish_checksum(), followed by
183+ * get_checksum().
184 *
185 * Instances of this class can be copied.
186 */
187@@ -93,24 +93,24 @@
188 ///
189 /// \param data data to compute chksum for
190 /// \param size size of data
191- void Data(const void * const newdata, const size_t size) {
192+ void data(const void * const newdata, const size_t size) {
193 assert(can_handle_data);
194 md5_process_bytes(newdata, size, &ctx);
195 }
196
197 /// This function finishes the checksum calculation.
198 /// After this, no more data may be written to the checksum.
199- void FinishChecksum() {
200+ void finish_checksum() {
201 assert(can_handle_data);
202 can_handle_data = 0;
203 md5_finish_ctx(&ctx, sum.data);
204 }
205
206- /// Retrieve the checksum. Note that \ref FinishChecksum must be called
207+ /// Retrieve the checksum. Note that \ref finish_checksum must be called
208 /// before this function.
209 ///
210 /// \return a pointer to an array of 16 bytes containing the checksum.
211- const Md5Checksum & GetChecksum() const {
212+ const Md5Checksum & get_checksum() const {
213 assert(!can_handle_data);
214 return sum;
215 }
216
217=== modified file 'src/chat/chat.h'
218--- src/chat/chat.h 2014-07-16 07:44:33 +0000
219+++ src/chat/chat.h 2014-09-29 14:39:47 +0000
220@@ -62,14 +62,14 @@
221 virtual ~ChatProvider();
222
223 // Send the given chat message. The message may or may not
224- // appear in subsequent calls to \ref getMessages.
225+ // appear in subsequent calls to \ref get_messages.
226 virtual void send(const std::string &) = 0;
227
228 // \return a (chronological) list of received chat messages.
229 // This list need not be stable or monotonic. In other words,
230 // subsequent calls to this functions may return a smaller or
231 // greater number of chat messages.
232- virtual const std::vector<ChatMessage>& getMessages() const = 0;
233+ virtual const std::vector<ChatMessage>& get_messages() const = 0;
234
235 // reimplemented e.g. in internet_gaming to silence the chat if in game.
236 // TODO(sirver): this does not belong here. The receiver of the
237
238=== modified file 'src/economy/cmd_call_economy_balance.cc'
239--- src/economy/cmd_call_economy_balance.cc 2014-09-10 08:55:04 +0000
240+++ src/economy/cmd_call_economy_balance.cc 2014-09-29 14:39:47 +0000
241@@ -53,24 +53,24 @@
242 /**
243 * Read and write
244 */
245-void CmdCallEconomyBalance::Read
246+void CmdCallEconomyBalance::read
247 (FileRead & fr, EditorGameBase & egbase, MapObjectLoader & mol)
248 {
249 try {
250- uint16_t const packet_version = fr.Unsigned16();
251+ uint16_t const packet_version = fr.unsigned_16();
252 if (packet_version == CURRENT_CMD_CALL_ECONOMY_VERSION) {
253- GameLogicCommand::Read(fr, egbase, mol);
254- uint32_t serial = fr.Unsigned32();
255+ GameLogicCommand::read(fr, egbase, mol);
256+ uint32_t serial = fr.unsigned_32();
257 if (serial)
258 m_flag = &mol.get<Flag>(serial);
259- m_timerid = fr.Unsigned32();
260+ m_timerid = fr.unsigned_32();
261 } else if (packet_version == 1 || packet_version == 2) {
262- GameLogicCommand::Read(fr, egbase, mol);
263- uint8_t const player_number = fr.Unsigned8();
264+ GameLogicCommand::read(fr, egbase, mol);
265+ uint8_t const player_number = fr.unsigned_8();
266 if (Player * const player = egbase.get_player(player_number)) {
267- if (!fr.Unsigned8())
268+ if (!fr.unsigned_8())
269 throw wexception("0 is not allowed here");
270- uint16_t const economy_number = fr.Unsigned16();
271+ uint16_t const economy_number = fr.unsigned_16();
272 if (economy_number < player->get_nr_economies())
273 m_flag =
274 player->get_economy_by_number(economy_number)
275@@ -80,7 +80,7 @@
276 } else
277 throw wexception("invalid player number %u", player_number);
278 if (packet_version >= 2)
279- m_timerid = fr.Unsigned32();
280+ m_timerid = fr.unsigned_32();
281 else
282 m_timerid = 0;
283 } else
284@@ -90,18 +90,18 @@
285 throw wexception("call economy balance: %s", e.what());
286 }
287 }
288-void CmdCallEconomyBalance::Write
289+void CmdCallEconomyBalance::write
290 (FileWrite & fw, EditorGameBase & egbase, MapObjectSaver & mos)
291 {
292- fw.Unsigned16(CURRENT_CMD_CALL_ECONOMY_VERSION);
293+ fw.unsigned_16(CURRENT_CMD_CALL_ECONOMY_VERSION);
294
295 // Write Base Commands
296- GameLogicCommand::Write(fw, egbase, mos);
297+ GameLogicCommand::write(fw, egbase, mos);
298 if (Flag * const flag = m_flag.get(egbase))
299- fw.Unsigned32(mos.get_object_file_index(*flag));
300+ fw.unsigned_32(mos.get_object_file_index(*flag));
301 else
302- fw.Unsigned32(0);
303- fw.Unsigned32(m_timerid);
304+ fw.unsigned_32(0);
305+ fw.unsigned_32(m_timerid);
306 }
307
308 }
309
310=== modified file 'src/economy/cmd_call_economy_balance.h'
311--- src/economy/cmd_call_economy_balance.h 2014-09-10 08:55:04 +0000
312+++ src/economy/cmd_call_economy_balance.h 2014-09-29 14:39:47 +0000
313@@ -39,8 +39,8 @@
314
315 uint8_t id() const override {return QUEUE_CMD_CALL_ECONOMY_BALANCE;}
316
317- void Write(FileWrite &, EditorGameBase &, MapObjectSaver &) override;
318- void Read (FileRead &, EditorGameBase &, MapObjectLoader &) override;
319+ void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override;
320+ void read (FileRead &, EditorGameBase &, MapObjectLoader &) override;
321
322 private:
323 OPtr<Flag> m_flag;
324
325=== modified file 'src/economy/economy.cc'
326--- src/economy/economy.cc 2014-09-14 11:31:58 +0000
327+++ src/economy/economy.cc 2014-09-29 14:39:47 +0000
328@@ -718,9 +718,9 @@
329 // alerts, so add info to the sync stream here.
330 {
331 ::StreamWrite & ss = game.syncstream();
332- ss.Unsigned8 (req.get_type ());
333- ss.Unsigned8 (req.get_index ());
334- ss.Unsigned32(req.target ().serial());
335+ ss.unsigned_8 (req.get_type ());
336+ ss.unsigned_8 (req.get_index ());
337+ ss.unsigned_32(req.target ().serial());
338 }
339
340 int32_t cost; // estimated time in milliseconds to fulfill Request
341@@ -1017,12 +1017,12 @@
342 // to avoid potential future problems caused by the m_supplies changing
343 // under us in some way.
344 ::StreamWrite & ss = game.syncstream();
345- ss.Unsigned32(0x02decafa); // appears as facade02 in sync stream
346- ss.Unsigned32(assignments.size());
347+ ss.unsigned_32(0x02decafa); // appears as facade02 in sync stream
348+ ss.unsigned_32(assignments.size());
349
350 for (const std::pair<Supply *, Warehouse *>& temp_assignment : assignments) {
351- ss.Unsigned32(temp_assignment.first->get_position(game)->serial());
352- ss.Unsigned32(temp_assignment.second->serial());
353+ ss.unsigned_32(temp_assignment.first->get_position(game)->serial());
354+ ss.unsigned_32(temp_assignment.second->serial());
355
356 temp_assignment.first->send_to_storage(game, temp_assignment.second);
357 }
358
359=== modified file 'src/economy/economy_data_packet.cc'
360--- src/economy/economy_data_packet.cc 2014-09-10 16:57:31 +0000
361+++ src/economy/economy_data_packet.cc 2014-09-29 14:39:47 +0000
362@@ -31,20 +31,20 @@
363
364 namespace Widelands {
365
366-void EconomyDataPacket::Read(FileRead & fr)
367+void EconomyDataPacket::read(FileRead & fr)
368 {
369- uint16_t const version = fr.Unsigned16();
370+ uint16_t const version = fr.unsigned_16();
371
372 try {
373 if (1 <= version && version <= CURRENT_ECONOMY_VERSION) {
374 if (2 <= version)
375 try {
376 const TribeDescr & tribe = m_eco->owner().tribe();
377- while (Time const last_modified = fr.Unsigned32()) {
378- char const * const type_name = fr.CString();
379- uint32_t const permanent = fr.Unsigned32();
380+ while (Time const last_modified = fr.unsigned_32()) {
381+ char const * const type_name = fr.c_string();
382+ uint32_t const permanent = fr.unsigned_32();
383 if (version <= 2)
384- fr.Unsigned32();
385+ fr.unsigned_32();
386 WareIndex i = tribe.ware_index(type_name);
387 if (i != INVALID_INDEX) {
388 if (tribe.get_ware_descr(i)->default_target_quantity() ==
389@@ -91,7 +91,7 @@
390 } catch (const WException & e) {
391 throw GameDataError("target quantities: %s", e.what());
392 }
393- m_eco->m_request_timerid = fr.Unsigned32();
394+ m_eco->m_request_timerid = fr.unsigned_32();
395 } else {
396 throw GameDataError("unknown version %u", version);
397 }
398@@ -100,18 +100,18 @@
399 }
400 }
401
402-void EconomyDataPacket::Write(FileWrite & fw)
403+void EconomyDataPacket::write(FileWrite & fw)
404 {
405- fw.Unsigned16(CURRENT_ECONOMY_VERSION);
406+ fw.unsigned_16(CURRENT_ECONOMY_VERSION);
407 const TribeDescr & tribe = m_eco->owner().tribe();
408 for (WareIndex i = tribe.get_nrwares(); i;) {
409 --i;
410 const Economy::TargetQuantity & tq =
411 m_eco->m_ware_target_quantities[i];
412 if (Time const last_modified = tq.last_modified) {
413- fw.Unsigned32(last_modified);
414- fw.CString(tribe.get_ware_descr(i)->name());
415- fw.Unsigned32(tq.permanent);
416+ fw.unsigned_32(last_modified);
417+ fw.c_string(tribe.get_ware_descr(i)->name());
418+ fw.unsigned_32(tq.permanent);
419 }
420 }
421 for (WareIndex i = tribe.get_nrworkers(); i;) {
422@@ -119,13 +119,13 @@
423 const Economy::TargetQuantity & tq =
424 m_eco->m_worker_target_quantities[i];
425 if (Time const last_modified = tq.last_modified) {
426- fw.Unsigned32(last_modified);
427- fw.CString(tribe.get_worker_descr(i)->name());
428- fw.Unsigned32(tq.permanent);
429+ fw.unsigned_32(last_modified);
430+ fw.c_string(tribe.get_worker_descr(i)->name());
431+ fw.unsigned_32(tq.permanent);
432 }
433 }
434- fw.Unsigned32(0); // terminator
435- fw.Unsigned32(m_eco->m_request_timerid);
436+ fw.unsigned_32(0); // terminator
437+ fw.unsigned_32(m_eco->m_request_timerid);
438 }
439
440 }
441
442=== modified file 'src/economy/economy_data_packet.h'
443--- src/economy/economy_data_packet.h 2014-09-10 07:57:29 +0000
444+++ src/economy/economy_data_packet.h 2014-09-29 14:39:47 +0000
445@@ -33,8 +33,8 @@
446 public:
447 EconomyDataPacket(Economy * e) : m_eco(e) {}
448
449- void Read(FileRead &);
450- void Write(FileWrite &);
451+ void read(FileRead &);
452+ void write(FileWrite &);
453
454 private:
455 Economy * m_eco;
456
457=== modified file 'src/economy/fleet.cc'
458--- src/economy/fleet.cc 2014-09-10 08:55:04 +0000
459+++ src/economy/fleet.cc 2014-09-29 14:39:47 +0000
460@@ -692,22 +692,22 @@
461
462 Fleet & fleet = get<Fleet>();
463
464- uint32_t nrships = fr.Unsigned32();
465+ uint32_t nrships = fr.unsigned_32();
466 m_ships.resize(nrships);
467 for (uint32_t i = 0; i < nrships; ++i)
468- m_ships[i] = fr.Unsigned32();
469+ m_ships[i] = fr.unsigned_32();
470
471- uint32_t nrports = fr.Unsigned32();
472+ uint32_t nrports = fr.unsigned_32();
473 m_ports.resize(nrports);
474 for (uint32_t i = 0; i < nrports; ++i)
475- m_ports[i] = fr.Unsigned32();
476+ m_ports[i] = fr.unsigned_32();
477
478 if (version >= 2) {
479- fleet.m_act_pending = fr.Unsigned8();
480+ fleet.m_act_pending = fr.unsigned_8();
481 if (version < 3)
482 fleet.m_act_pending = false;
483 if (version < 4)
484- fr.Unsigned32(); // m_roundrobin
485+ fr.unsigned_32(); // m_roundrobin
486 }
487 }
488
489@@ -756,9 +756,9 @@
490
491 try {
492 // The header has been peeled away by the caller
493- uint8_t const version = fr.Unsigned8();
494+ uint8_t const version = fr.unsigned_8();
495 if (1 <= version && version <= FLEET_SAVEGAME_VERSION) {
496- PlayerNumber owner_number = fr.Unsigned8();
497+ PlayerNumber owner_number = fr.unsigned_8();
498 if (!owner_number || owner_number > egbase.map().get_nrplayers())
499 throw GameDataError
500 ("owner number is %u but there are only %u players",
501@@ -781,23 +781,23 @@
502
503 void Fleet::save(EditorGameBase & egbase, MapObjectSaver & mos, FileWrite & fw)
504 {
505- fw.Unsigned8(HeaderFleet);
506- fw.Unsigned8(FLEET_SAVEGAME_VERSION);
507+ fw.unsigned_8(HeaderFleet);
508+ fw.unsigned_8(FLEET_SAVEGAME_VERSION);
509
510- fw.Unsigned8(m_owner.player_number());
511+ fw.unsigned_8(m_owner.player_number());
512
513 MapObject::save(egbase, mos, fw);
514
515- fw.Unsigned32(m_ships.size());
516+ fw.unsigned_32(m_ships.size());
517 for (const Ship * temp_ship : m_ships) {
518- fw.Unsigned32(mos.get_object_file_index(*temp_ship));
519+ fw.unsigned_32(mos.get_object_file_index(*temp_ship));
520 }
521- fw.Unsigned32(m_ports.size());
522+ fw.unsigned_32(m_ports.size());
523 for (const PortDock * temp_port : m_ports) {
524- fw.Unsigned32(mos.get_object_file_index(*temp_port));
525+ fw.unsigned_32(mos.get_object_file_index(*temp_port));
526 }
527
528- fw.Unsigned8(m_act_pending);
529+ fw.unsigned_8(m_act_pending);
530 }
531
532 } // namespace Widelands
533
534=== modified file 'src/economy/portdock.cc'
535--- src/economy/portdock.cc 2014-09-10 10:18:46 +0000
536+++ src/economy/portdock.cc 2014-09-29 14:39:47 +0000
537@@ -478,29 +478,29 @@
538
539 PortDock & pd = get<PortDock>();
540
541- m_warehouse = fr.Unsigned32();
542- uint16_t nrdockpoints = fr.Unsigned16();
543+ m_warehouse = fr.unsigned_32();
544+ uint16_t nrdockpoints = fr.unsigned_16();
545
546 pd.m_dockpoints.resize(nrdockpoints);
547 for (uint16_t i = 0; i < nrdockpoints; ++i) {
548- pd.m_dockpoints[i] = ReadCoords32(&fr, egbase().map().extent());
549+ pd.m_dockpoints[i] = read_coords_32(&fr, egbase().map().extent());
550 pd.set_position(egbase(), pd.m_dockpoints[i]);
551 }
552
553 if (version >= 2) {
554- pd.m_need_ship = fr.Unsigned8();
555+ pd.m_need_ship = fr.unsigned_8();
556
557- m_waiting.resize(fr.Unsigned32());
558+ m_waiting.resize(fr.unsigned_32());
559 for (ShippingItem::Loader& shipping_loader : m_waiting) {
560 shipping_loader.load(fr);
561 }
562
563 if (version >= 3) {
564 // All the other expedition specific stuff is saved in the warehouse.
565- if (fr.Unsigned8()) { // Do we have an expedition?
566+ if (fr.unsigned_8()) { // Do we have an expedition?
567 pd.m_expedition_bootstrap.reset(new ExpeditionBootstrap(&pd));
568 }
569- pd.m_expedition_ready = (fr.Unsigned8() == 1) ? true : false;
570+ pd.m_expedition_ready = (fr.unsigned_8() == 1) ? true : false;
571 } else {
572 pd.m_expedition_ready = false;
573 }
574@@ -545,7 +545,7 @@
575 try {
576 // The header has been peeled away by the caller
577
578- uint8_t const version = fr.Unsigned8();
579+ uint8_t const version = fr.unsigned_8();
580 if (1 <= version && version <= PORTDOCK_SAVEGAME_VERSION) {
581 loader->init(egbase, mol, *new PortDock(nullptr));
582 loader->load(fr, version);
583@@ -560,27 +560,27 @@
584
585 void PortDock::save(EditorGameBase & egbase, MapObjectSaver & mos, FileWrite & fw)
586 {
587- fw.Unsigned8(HeaderPortDock);
588- fw.Unsigned8(PORTDOCK_SAVEGAME_VERSION);
589+ fw.unsigned_8(HeaderPortDock);
590+ fw.unsigned_8(PORTDOCK_SAVEGAME_VERSION);
591
592 PlayerImmovable::save(egbase, mos, fw);
593
594- fw.Unsigned32(mos.get_object_file_index(*m_warehouse));
595- fw.Unsigned16(m_dockpoints.size());
596+ fw.unsigned_32(mos.get_object_file_index(*m_warehouse));
597+ fw.unsigned_16(m_dockpoints.size());
598 for (const Coords& coords: m_dockpoints) {
599- WriteCoords32(&fw, coords);
600+ write_coords_32(&fw, coords);
601 }
602
603- fw.Unsigned8(m_need_ship);
604+ fw.unsigned_8(m_need_ship);
605
606- fw.Unsigned32(m_waiting.size());
607+ fw.unsigned_32(m_waiting.size());
608 for (ShippingItem& shipping_item : m_waiting) {
609 shipping_item.save(egbase, mos, fw);
610 }
611
612 // Expedition specific stuff
613- fw.Unsigned8(m_expedition_bootstrap.get() != nullptr ? 1 : 0);
614- fw.Unsigned8(m_expedition_ready ? 1 : 0);
615+ fw.unsigned_8(m_expedition_bootstrap.get() != nullptr ? 1 : 0);
616+ fw.unsigned_8(m_expedition_ready ? 1 : 0);
617 }
618
619 } // namespace Widelands
620
621=== modified file 'src/economy/request.cc'
622--- src/economy/request.cc 2014-09-14 12:13:35 +0000
623+++ src/economy/request.cc 2014-09-29 14:39:47 +0000
624@@ -105,14 +105,14 @@
625 * might have been initialized. We have to kill them and replace
626 * them through the data in the file
627 */
628-void Request::Read
629+void Request::read
630 (FileRead & fr, Game & game, MapObjectLoader & mol)
631 {
632 try {
633- uint16_t const version = fr.Unsigned16();
634+ uint16_t const version = fr.unsigned_16();
635 if (version == 6) {
636 const TribeDescr& tribe = m_target.owner().tribe();
637- char const* const type_name = fr.CString();
638+ char const* const type_name = fr.c_string();
639 WareIndex const wai = tribe.ware_index(type_name);
640 if (wai != INVALID_INDEX) {
641 m_type = wwWARE;
642@@ -123,32 +123,32 @@
643 m_type = wwWORKER;
644 m_index = woi;
645 } else {
646- throw wexception("Request::Read: unknown type '%s'.\n", type_name);
647+ throw wexception("Request::read: unknown type '%s'.\n", type_name);
648 }
649 }
650- m_count = fr.Unsigned32();
651- m_required_time = fr.Unsigned32();
652- m_required_interval = fr.Unsigned32();
653+ m_count = fr.unsigned_32();
654+ m_required_time = fr.unsigned_32();
655+ m_required_interval = fr.unsigned_32();
656
657- m_last_request_time = fr.Unsigned32();
658+ m_last_request_time = fr.unsigned_32();
659
660 assert(m_transfers.empty());
661
662- uint16_t const nr_transfers = fr.Unsigned16();
663+ uint16_t const nr_transfers = fr.unsigned_16();
664 for (uint16_t i = 0; i < nr_transfers; ++i)
665 try {
666- MapObject* obj = &mol.get<MapObject>(fr.Unsigned32());
667+ MapObject* obj = &mol.get<MapObject>(fr.unsigned_32());
668 Transfer* transfer;
669
670 if (upcast(Worker, worker, obj)) {
671 transfer = worker->get_transfer();
672 if (m_type != wwWORKER || !worker->descr().can_act_as(m_index)) {
673- throw wexception("Request::Read: incompatible transfer type");
674+ throw wexception("Request::read: incompatible transfer type");
675 }
676 } else if (upcast(WareInstance, ware, obj)) {
677 transfer = ware->get_transfer();
678 if (m_type != wwWARE || ware->descr_index() != m_index) {
679- throw wexception("Request::Read: incompatible transfer type");
680+ throw wexception("Request::read: incompatible transfer type");
681 }
682 } else {
683 throw wexception("transfer target %u is neither ware nor worker", obj->serial());
684@@ -164,7 +164,7 @@
685 } catch (const WException& e) {
686 throw wexception("transfer %u: %s", i, e.what());
687 }
688- m_requirements.Read (fr, game, mol);
689+ m_requirements.read (fr, game, mol);
690 if (!is_open() && m_economy)
691 m_economy->remove_request(*this);
692 } else
693@@ -177,10 +177,10 @@
694 /**
695 * Write this request to a file
696 */
697-void Request::Write
698+void Request::write
699 (FileWrite & fw, Game & game, MapObjectSaver & mos) const
700 {
701- fw.Unsigned16(REQUEST_VERSION);
702+ fw.unsigned_16(REQUEST_VERSION);
703
704 // Target and econmy should be set. Same is true for callback stuff.
705
706@@ -188,30 +188,30 @@
707 const TribeDescr & tribe = m_target.owner().tribe();
708 assert(m_type != wwWARE || m_index < tribe.get_nrwares ());
709 assert(m_type != wwWORKER || m_index < tribe.get_nrworkers());
710- fw.CString
711+ fw.c_string
712 (m_type == wwWARE ?
713 tribe.get_ware_descr (m_index)->name() :
714 tribe.get_worker_descr(m_index)->name());
715
716- fw.Unsigned32(m_count);
717-
718- fw.Unsigned32(m_required_time);
719- fw.Unsigned32(m_required_interval);
720-
721- fw.Unsigned32(m_last_request_time);
722-
723- fw.Unsigned16(m_transfers.size()); // Write number of current transfers.
724+ fw.unsigned_32(m_count);
725+
726+ fw.unsigned_32(m_required_time);
727+ fw.unsigned_32(m_required_interval);
728+
729+ fw.unsigned_32(m_last_request_time);
730+
731+ fw.unsigned_16(m_transfers.size()); // Write number of current transfers.
732 for (uint32_t i = 0; i < m_transfers.size(); ++i) {
733 Transfer & trans = *m_transfers[i];
734 if (trans.m_ware) { // write ware/worker
735 assert(mos.is_object_known(*trans.m_ware));
736- fw.Unsigned32(mos.get_object_file_index(*trans.m_ware));
737+ fw.unsigned_32(mos.get_object_file_index(*trans.m_ware));
738 } else if (trans.m_worker) {
739 assert(mos.is_object_known(*trans.m_worker));
740- fw.Unsigned32(mos.get_object_file_index(*trans.m_worker));
741+ fw.unsigned_32(mos.get_object_file_index(*trans.m_worker));
742 }
743 }
744- m_requirements.Write (fw, game, mos);
745+ m_requirements.write (fw, game, mos);
746 }
747
748 /**
749@@ -407,16 +407,16 @@
750 assert(is_open());
751
752 ::StreamWrite & ss = game.syncstream();
753- ss.Unsigned32(0x01decafa); // appears as facade01 in sync stream
754- ss.Unsigned32(target().serial());
755- ss.Unsigned32(supp.get_position(game)->serial());
756+ ss.unsigned_32(0x01decafa); // appears as facade01 in sync stream
757+ ss.unsigned_32(target().serial());
758+ ss.unsigned_32(supp.get_position(game)->serial());
759
760 Transfer * t;
761 if (get_type() == wwWORKER) {
762 // Begin the transfer of a soldier or worker.
763 // launch_worker() creates or starts the worker
764 Worker & s = supp.launch_worker(game, *this);
765- ss.Unsigned32(s.serial());
766+ ss.unsigned_32(s.serial());
767 t = new Transfer(game, *this, s);
768 } else {
769 // Begin the transfer of an ware. The ware itself is passive.
770@@ -424,7 +424,7 @@
771 // warehouse. Once it's on the flag, the flag code will decide what to
772 // do with it.
773 WareInstance & ware = supp.launch_ware(game, *this);
774- ss.Unsigned32(ware.serial());
775+ ss.unsigned_32(ware.serial());
776 t = new Transfer(game, *this, ware);
777 }
778
779
780=== modified file 'src/economy/request.h'
781--- src/economy/request.h 2014-09-14 12:13:35 +0000
782+++ src/economy/request.h 2014-09-29 14:39:47 +0000
783@@ -93,8 +93,8 @@
784
785 void start_transfer(Game &, Supply &);
786
787- void Read (FileRead &, Game &, MapObjectLoader &);
788- void Write(FileWrite &, Game &, MapObjectSaver &) const;
789+ void read (FileRead &, Game &, MapObjectLoader &);
790+ void write(FileWrite &, Game &, MapObjectSaver &) const;
791 Worker * get_transfer_worker();
792
793 // callbacks for WareInstance/Worker code
794
795=== modified file 'src/economy/road.cc'
796--- src/economy/road.cc 2014-09-10 13:03:40 +0000
797+++ src/economy/road.cc 2014-09-29 14:39:47 +0000
798@@ -41,7 +41,7 @@
799 return g_road_descr;
800 }
801
802-bool Road::IsRoadDescr(MapObjectDescr const * const descr)
803+bool Road::is_road_descr(MapObjectDescr const * const descr)
804 {
805 return descr == &g_road_descr;
806 }
807@@ -480,7 +480,7 @@
808 assert(static_cast<uint32_t>(index) < path.get_nsteps() - 1);
809
810 path.truncate(index);
811- secondpath.starttrim(index);
812+ secondpath.trim_start(index);
813
814 molog("splitting road: first part:\n");
815 for (const Coords& coords : path.get_coords()) {
816
817=== modified file 'src/economy/road.h'
818--- src/economy/road.h 2014-09-14 11:31:58 +0000
819+++ src/economy/road.h 2014-09-29 14:39:47 +0000
820@@ -63,7 +63,7 @@
821
822 const RoadDescr& descr() const;
823
824- static bool IsRoadDescr(MapObjectDescr const *);
825+ static bool is_road_descr(MapObjectDescr const *);
826
827 enum FlagId {
828 FlagStart = 0,
829
830=== modified file 'src/economy/route.cc'
831--- src/economy/route.cc 2014-09-10 10:18:46 +0000
832+++ src/economy/route.cc 2014-09-29 14:39:47 +0000
833@@ -63,7 +63,7 @@
834 /**
835 * Remove the first count steps from the route.
836 */
837-void Route::starttrim(int32_t count)
838+void Route::trim_start(int32_t count)
839 {
840 assert(count < static_cast<int32_t>(m_route.size()));
841
842@@ -91,10 +91,10 @@
843 {
844 m_route.clear();
845
846- m_totalcost = fr.Signed32();
847- uint32_t nsteps = fr.Unsigned16();
848+ m_totalcost = fr.signed_32();
849+ uint32_t nsteps = fr.unsigned_16();
850 for (uint32_t step = 0; step < nsteps; ++step)
851- data.flags.push_back(fr.Unsigned32());
852+ data.flags.push_back(fr.unsigned_32());
853 }
854
855
856@@ -120,8 +120,8 @@
857 void Route::save
858 (FileWrite & fw, EditorGameBase & egbase, MapObjectSaver & mos)
859 {
860- fw.Signed32(get_totalcost());
861- fw.Unsigned16(m_route.size());
862+ fw.signed_32(get_totalcost());
863+ fw.unsigned_16(m_route.size());
864 for
865 (std::vector<ObjectPointer>::size_type idx = 0;
866 idx < m_route.size();
867@@ -129,7 +129,7 @@
868 {
869 Flag & flag = get_flag(egbase, idx);
870 assert(mos.is_object_known(flag));
871- fw.Unsigned32(mos.get_object_file_index(flag));
872+ fw.unsigned_32(mos.get_object_file_index(flag));
873 }
874 }
875
876
877=== modified file 'src/economy/route.h'
878--- src/economy/route.h 2014-09-10 08:55:04 +0000
879+++ src/economy/route.h 2014-09-29 14:39:47 +0000
880@@ -50,7 +50,7 @@
881 int32_t get_nrsteps() const {return m_route.size() - 1;}
882 Flag & get_flag(EditorGameBase &, std::vector<Flag *>::size_type);
883
884- void starttrim(int32_t count);
885+ void trim_start(int32_t count);
886 void truncate(int32_t count);
887
888 struct LoadData {
889
890=== modified file 'src/economy/shippingitem.cc'
891--- src/economy/shippingitem.cc 2014-09-10 08:55:04 +0000
892+++ src/economy/shippingitem.cc 2014-09-29 14:39:47 +0000
893@@ -167,9 +167,9 @@
894
895 void ShippingItem::Loader::load(FileRead & fr)
896 {
897- uint8_t version = fr.Unsigned8();
898+ uint8_t version = fr.unsigned_8();
899 if (1 <= version && version <= SHIPPINGITEM_SAVEGAME_VERSION) {
900- m_serial = fr.Unsigned32();
901+ m_serial = fr.unsigned_32();
902 } else
903 throw GameDataError("unknown ShippingItem version %u", version);
904 }
905@@ -184,8 +184,8 @@
906
907 void ShippingItem::save(EditorGameBase & egbase, MapObjectSaver & mos, FileWrite & fw)
908 {
909- fw.Unsigned8(SHIPPINGITEM_SAVEGAME_VERSION);
910- fw.Unsigned32(mos.get_object_file_index_or_zero(m_object.get(egbase)));
911+ fw.unsigned_8(SHIPPINGITEM_SAVEGAME_VERSION);
912+ fw.unsigned_32(mos.get_object_file_index_or_zero(m_object.get(egbase)));
913 }
914
915 } // namespace Widelands
916
917=== modified file 'src/economy/transfer.cc'
918--- src/economy/transfer.cc 2014-09-10 07:57:29 +0000
919+++ src/economy/transfer.cc 2014-09-29 14:39:47 +0000
920@@ -178,7 +178,7 @@
921 if (m_route.get_nrsteps() >= 1)
922 if (upcast(Road const, road, location))
923 if (&road->get_flag(Road::FlagEnd) == &m_route.get_flag(m_game, 1))
924- m_route.starttrim(1);
925+ m_route.trim_start(1);
926
927 if (m_route.get_nrsteps() >= 1)
928 if (upcast(Road const, road, destination))
929@@ -316,11 +316,11 @@
930
931 void Transfer::read(FileRead & fr, Transfer::ReadData & rd)
932 {
933- uint8_t version = fr.Unsigned8();
934+ uint8_t version = fr.unsigned_8();
935 if (version != TRANSFER_SAVEGAME_VERSION)
936 throw wexception("unhandled/unknown transfer version %u", version);
937
938- rd.destination = fr.Unsigned32();
939+ rd.destination = fr.unsigned_32();
940 }
941
942 void Transfer::read_pointers
943@@ -332,8 +332,8 @@
944
945 void Transfer::write(MapObjectSaver & mos, FileWrite & fw)
946 {
947- fw.Unsigned8(TRANSFER_SAVEGAME_VERSION);
948- fw.Unsigned32(mos.get_object_file_index_or_zero(m_destination.get(m_game)));
949+ fw.unsigned_8(TRANSFER_SAVEGAME_VERSION);
950+ fw.unsigned_32(mos.get_object_file_index_or_zero(m_destination.get(m_game)));
951 // not saving route right now, will be recaculated anyway
952 }
953
954
955=== modified file 'src/economy/ware_instance.cc'
956--- src/economy/ware_instance.cc 2014-09-10 10:18:46 +0000
957+++ src/economy/ware_instance.cc 2014-09-29 14:39:47 +0000
958@@ -557,9 +557,9 @@
959 MapObject::Loader::load(fr);
960
961 WareInstance & ware = get<WareInstance>();
962- m_location = fr.Unsigned32();
963- m_transfer_nextstep = fr.Unsigned32();
964- if (fr.Unsigned8()) {
965+ m_location = fr.unsigned_32();
966+ m_transfer_nextstep = fr.unsigned_32();
967+ if (fr.unsigned_8()) {
968 ware.m_transfer =
969 new Transfer(ref_cast<Game, EditorGameBase>(egbase()), ware);
970 ware.m_transfer->read(fr, m_transfer);
971@@ -598,21 +598,21 @@
972 void WareInstance::save
973 (EditorGameBase & egbase, MapObjectSaver & mos, FileWrite & fw)
974 {
975- fw.Unsigned8(HeaderWareInstance);
976- fw.Unsigned8(WAREINSTANCE_SAVEGAME_VERSION);
977- fw.CString(descr().tribe().name());
978- fw.CString(descr().name());
979+ fw.unsigned_8(HeaderWareInstance);
980+ fw.unsigned_8(WAREINSTANCE_SAVEGAME_VERSION);
981+ fw.c_string(descr().tribe().name());
982+ fw.c_string(descr().name());
983
984 MapObject::save(egbase, mos, fw);
985
986- fw.Unsigned32(mos.get_object_file_index_or_zero(m_location.get(egbase)));
987- fw.Unsigned32
988+ fw.unsigned_32(mos.get_object_file_index_or_zero(m_location.get(egbase)));
989+ fw.unsigned_32
990 (mos.get_object_file_index_or_zero(m_transfer_nextstep.get(egbase)));
991 if (m_transfer) {
992- fw.Unsigned8(1);
993+ fw.unsigned_8(1);
994 m_transfer->write(mos, fw);
995 } else {
996- fw.Unsigned8(0);
997+ fw.unsigned_8(0);
998 }
999 }
1000
1001@@ -620,13 +620,13 @@
1002 (EditorGameBase & egbase, MapObjectLoader & mol, FileRead & fr)
1003 {
1004 try {
1005- uint8_t version = fr.Unsigned8();
1006+ uint8_t version = fr.unsigned_8();
1007
1008 if (version != WAREINSTANCE_SAVEGAME_VERSION)
1009 throw wexception("unknown/unhandled version %i", version);
1010
1011- const std::string tribename = fr.CString();
1012- const std::string warename = fr.CString();
1013+ const std::string tribename = fr.c_string();
1014+ const std::string warename = fr.c_string();
1015
1016 egbase.manually_load_tribe(tribename);
1017
1018
1019=== modified file 'src/economy/wares_queue.cc'
1020--- src/economy/wares_queue.cc 2014-09-14 12:13:35 +0000
1021+++ src/economy/wares_queue.cc 2014-09-29 14:39:47 +0000
1022@@ -235,47 +235,47 @@
1023 * Read and write
1024 */
1025 #define WARES_QUEUE_DATA_PACKET_VERSION 2
1026-void WaresQueue::Write(FileWrite & fw, Game & game, MapObjectSaver & mos)
1027+void WaresQueue::write(FileWrite & fw, Game & game, MapObjectSaver & mos)
1028 {
1029- fw.Unsigned16(WARES_QUEUE_DATA_PACKET_VERSION);
1030+ fw.unsigned_16(WARES_QUEUE_DATA_PACKET_VERSION);
1031
1032 // Owner and callback is not saved, but this should be obvious on load.
1033- fw.CString
1034+ fw.c_string
1035 (owner().tribe().get_ware_descr(m_ware)->name().c_str());
1036- fw.Signed32(m_max_size);
1037- fw.Signed32(m_max_fill);
1038- fw.Signed32(m_filled);
1039- fw.Signed32(m_consume_interval);
1040+ fw.signed_32(m_max_size);
1041+ fw.signed_32(m_max_fill);
1042+ fw.signed_32(m_filled);
1043+ fw.signed_32(m_consume_interval);
1044 if (m_request) {
1045- fw.Unsigned8(1);
1046- m_request->Write(fw, game, mos);
1047+ fw.unsigned_8(1);
1048+ m_request->write(fw, game, mos);
1049 } else
1050- fw.Unsigned8(0);
1051+ fw.unsigned_8(0);
1052 }
1053
1054
1055-void WaresQueue::Read(FileRead & fr, Game & game, MapObjectLoader & mol)
1056+void WaresQueue::read(FileRead & fr, Game & game, MapObjectLoader & mol)
1057 {
1058- uint16_t const packet_version = fr.Unsigned16();
1059+ uint16_t const packet_version = fr.unsigned_16();
1060 try {
1061 if (packet_version == WARES_QUEUE_DATA_PACKET_VERSION || packet_version == 1) {
1062 delete m_request;
1063- m_ware = owner().tribe().ware_index(fr.CString ());
1064- m_max_size = fr.Unsigned32();
1065+ m_ware = owner().tribe().ware_index(fr.c_string ());
1066+ m_max_size = fr.unsigned_32();
1067 if (packet_version == 1)
1068 m_max_fill = m_max_size;
1069 else
1070- m_max_fill = fr.Signed32();
1071- m_filled = fr.Unsigned32();
1072- m_consume_interval = fr.Unsigned32();
1073- if (fr.Unsigned8 ()) {
1074- m_request = // TODO(unknown): Change Request::Read
1075+ m_max_fill = fr.signed_32();
1076+ m_filled = fr.unsigned_32();
1077+ m_consume_interval = fr.unsigned_32();
1078+ if (fr.unsigned_8 ()) {
1079+ m_request = // TODO(unknown): Change Request::read
1080 new Request // to a constructor.
1081 (m_owner,
1082 0,
1083 WaresQueue::request_callback,
1084 wwWORKER);
1085- m_request->Read(fr, game, mol);
1086+ m_request->read(fr, game, mol);
1087 } else
1088 m_request = nullptr;
1089
1090
1091=== modified file 'src/economy/wares_queue.h'
1092--- src/economy/wares_queue.h 2014-09-14 12:13:35 +0000
1093+++ src/economy/wares_queue.h 2014-09-29 14:39:47 +0000
1094@@ -67,8 +67,8 @@
1095
1096 Player & owner() const {return m_owner.owner();}
1097
1098- void Read (FileRead &, Game &, MapObjectLoader &);
1099- void Write(FileWrite &, Game &, MapObjectSaver &);
1100+ void read (FileRead &, Game &, MapObjectLoader &);
1101+ void write(FileWrite &, Game &, MapObjectSaver &);
1102
1103 private:
1104 static void request_callback
1105
1106=== modified file 'src/editor/editorinteractive.cc'
1107--- src/editor/editorinteractive.cc 2014-09-14 16:08:13 +0000
1108+++ src/editor/editorinteractive.cc 2014-09-29 14:39:47 +0000
1109@@ -244,7 +244,7 @@
1110 m_realtime = WLApplication::get()->get_time();
1111 frametime = m_realtime - lasttime;
1112
1113- egbase().get_game_time_pointer() += frametime;
1114+ egbase().get_gametime_pointer() += frametime;
1115
1116 g_gr->animate_maptextures(egbase().get_gametime());
1117 }
1118
1119=== modified file 'src/editor/map_generator.cc'
1120--- src/editor/map_generator.cc 2014-09-14 11:31:58 +0000
1121+++ src/editor/map_generator.cc 2014-09-29 14:39:47 +0000
1122@@ -59,13 +59,13 @@
1123 MapGenAreaInfo::MapGenTerrainType const terrType)
1124 {
1125 // Figure out which bob area is due here...
1126- size_t num = map_gen_info_->getNumLandResources();
1127+ size_t num = map_gen_info_->get_num_land_resources();
1128 size_t found = num;
1129- uint32_t sum_weight = map_gen_info_->getSumLandResourceWeight();
1130+ uint32_t sum_weight = map_gen_info_->get_sum_land_resource_weight();
1131 uint32_t max_val = 0;
1132 for (size_t ix = 0; ix < num; ++ix) {
1133 uint32_t val = random_bobs[ix][fc.x + map_info_.w * fc.y];
1134- val = (val / sum_weight) * map_gen_info_->getLandResource(ix).getWeight();
1135+ val = (val / sum_weight) * map_gen_info_->get_land_resource(ix).get_weight();
1136 if (val >= max_val) {
1137 found = ix;
1138 max_val = val;
1139@@ -76,15 +76,15 @@
1140
1141 // Figure out if we really need to set a bob here...
1142
1143- const MapGenLandResource & landResource = map_gen_info_->getLandResource(found);
1144+ const MapGenLandResource & landResource = map_gen_info_->get_land_resource(found);
1145
1146- const MapGenBobCategory * bobCategory = landResource.getBobCategory(terrType);
1147+ const MapGenBobCategory * bobCategory = landResource.get_bob_category(terrType);
1148
1149 if (!bobCategory) // no bobs defined here...
1150 return;
1151
1152- uint32_t immovDens = landResource.getImmovableDensity();
1153- uint32_t movDens = landResource.getMoveableDensity();
1154+ uint32_t immovDens = landResource.get_immovable_density();
1155+ uint32_t movDens = landResource.get_moveable_density();
1156
1157 immovDens *= max_val / 100;
1158 movDens *= max_val / 100;
1159@@ -136,7 +136,7 @@
1160 uint8_t res_val = static_cast<uint8_t>(random_value / (kMaxElevation / max_amount));
1161 res_val *= static_cast<uint8_t>(map_info_.resource_amount) + 1;
1162 res_val /= 3;
1163- if (Editor_Change_Resource_Tool_Callback(fc, map_, world, res_idx)) {
1164+ if (editor_change_resource_tool_callback(fc, map_, world, res_idx)) {
1165 fc.field->set_resources(res_idx, res_val);
1166 fc.field->set_starting_res_amount(res_val);
1167 }
1168@@ -205,9 +205,9 @@
1169 (double const elevation,
1170 Coords const c)
1171 {
1172- int32_t const water_h = map_gen_info_->getWaterShallowHeight();
1173- int32_t const mount_h = map_gen_info_->getMountainFootHeight();
1174- int32_t const summit_h = map_gen_info_->getSummitHeight ();
1175+ int32_t const water_h = map_gen_info_->get_water_shallow_height();
1176+ int32_t const mount_h = map_gen_info_->get_mountain_foot_height();
1177+ int32_t const summit_h = map_gen_info_->get_summit_height ();
1178
1179 double const water_fac = map_info_.waterRatio;
1180 double const land_fac = map_info_.landRatio;
1181@@ -452,9 +452,9 @@
1182 MapGenAreaInfo::MapGenTerrainType & terrType)
1183 {
1184 uint32_t numLandAreas =
1185- map_gen_info_->getNumAreas(MapGenAreaInfo::atLand);
1186+ map_gen_info_->get_num_areas(MapGenAreaInfo::atLand);
1187 uint32_t const numWasteLandAreas =
1188- map_gen_info_->getNumAreas(MapGenAreaInfo::atWasteland);
1189+ map_gen_info_->get_num_areas(MapGenAreaInfo::atWasteland);
1190
1191 bool isDesert = false;
1192 bool isDesertOuter = false;
1193@@ -516,10 +516,10 @@
1194 landAreaIndex = 0;
1195 else if (numLandAreas == 2) {
1196 uint32_t const weight1 =
1197- map_gen_info_->getArea(MapGenAreaInfo::atLand, 0).getWeight();
1198+ map_gen_info_->get_area(MapGenAreaInfo::atLand, 0).get_weight();
1199 uint32_t const weight2 =
1200- map_gen_info_->getArea(MapGenAreaInfo::atLand, 1).getWeight();
1201- uint32_t const sum = map_gen_info_->getSumLandWeight();
1202+ map_gen_info_->get_area(MapGenAreaInfo::atLand, 1).get_weight();
1203+ uint32_t const sum = map_gen_info_->get_sum_land_weight();
1204 if
1205 (weight1 * (random2[c0.x + map_info_.w * c0.y] / sum)
1206 >=
1207@@ -529,12 +529,12 @@
1208 landAreaIndex = 1;
1209 } else {
1210 uint32_t const weight1 =
1211- map_gen_info_->getArea(MapGenAreaInfo::atLand, 0).getWeight();
1212+ map_gen_info_->get_area(MapGenAreaInfo::atLand, 0).get_weight();
1213 uint32_t const weight2 =
1214- map_gen_info_->getArea(MapGenAreaInfo::atLand, 1).getWeight();
1215+ map_gen_info_->get_area(MapGenAreaInfo::atLand, 1).get_weight();
1216 uint32_t const weight3 =
1217- map_gen_info_->getArea(MapGenAreaInfo::atLand, 2).getWeight();
1218- uint32_t const sum = map_gen_info_->getSumLandWeight();
1219+ map_gen_info_->get_area(MapGenAreaInfo::atLand, 2).get_weight();
1220+ uint32_t const sum = map_gen_info_->get_sum_land_weight();
1221 uint32_t const randomX = (rand2 + rand3) / 2;
1222 if
1223 (weight1 * (rand2 / sum) > weight2 * (rand3 / sum) &&
1224@@ -557,14 +557,14 @@
1225
1226 // see whether it is water
1227
1228- uint32_t const coast_h = map_gen_info_->getLandCoastHeight();
1229+ uint32_t const coast_h = map_gen_info_->get_land_coast_height();
1230 if (h1 <= coast_h && h2 <= coast_h && h3 <= coast_h) { // water or coast...
1231 atp = MapGenAreaInfo::atLand;
1232 ttp = MapGenAreaInfo::ttLandCoast;
1233
1234- uint32_t const ocean_h = map_gen_info_->getWaterOceanHeight();
1235- uint32_t const shelf_h = map_gen_info_->getWaterShelfHeight();
1236- uint32_t const shallow_h = map_gen_info_->getWaterShallowHeight();
1237+ uint32_t const ocean_h = map_gen_info_->get_water_ocean_height();
1238+ uint32_t const shelf_h = map_gen_info_->get_water_shelf_height();
1239+ uint32_t const shallow_h = map_gen_info_->get_water_shallow_height();
1240
1241 // TODO(unknown): The heights can not be lower than water-Shallow --
1242 // there will never be an ocean yet
1243@@ -580,10 +580,10 @@
1244 ttp = MapGenAreaInfo::ttWaterShallow;
1245 }
1246 } else { // it is not water
1247- uint32_t const upper_h = map_gen_info_->getLandUpperHeight ();
1248- uint32_t const foot_h = map_gen_info_->getMountainFootHeight();
1249- uint32_t const mount_h = map_gen_info_->getMountainHeight ();
1250- uint32_t const snow_h = map_gen_info_->getSnowHeight ();
1251+ uint32_t const upper_h = map_gen_info_->get_land_upper_height ();
1252+ uint32_t const foot_h = map_gen_info_->get_mountain_foot_height();
1253+ uint32_t const mount_h = map_gen_info_->get_mountain_height ();
1254+ uint32_t const snow_h = map_gen_info_->get_snow_height ();
1255 if (h1 >= snow_h && h2 >= snow_h && h3 >= snow_h) {
1256 atp = MapGenAreaInfo::atMountains;
1257 ttp = MapGenAreaInfo::ttMountainsSnow;
1258@@ -616,11 +616,11 @@
1259
1260 // Figure out which terrain to use at this point in the map...
1261 return
1262- map_gen_info_->getArea(atp, usedLandIndex).getTerrain
1263+ map_gen_info_->get_area(atp, usedLandIndex).get_terrain
1264 (ttp,
1265 rng.rand()
1266 %
1267- map_gen_info_->getArea(atp, usedLandIndex).getNumTerrains(ttp));
1268+ map_gen_info_->get_area(atp, usedLandIndex).get_num_terrains(ttp));
1269
1270 }
1271
1272@@ -663,9 +663,9 @@
1273
1274 // for bobs
1275 std::unique_ptr<std::unique_ptr<uint32_t[]> []> random_bobs
1276- (new std::unique_ptr<uint32_t[]> [map_gen_info_->getNumLandResources()]);
1277+ (new std::unique_ptr<uint32_t[]> [map_gen_info_->get_num_land_resources()]);
1278
1279- for (size_t ix = 0; ix < map_gen_info_->getNumLandResources(); ++ix)
1280+ for (size_t ix = 0; ix < map_gen_info_->get_num_land_resources(); ++ix)
1281 random_bobs[ix].reset
1282 (generate_random_value_map(map_info_.w, map_info_.h, rng));
1283
1284@@ -871,7 +871,7 @@
1285 ===============
1286 */
1287
1288-int UniqueRandomMapInfo::mapIdCharToNumber(char ch)
1289+int UniqueRandomMapInfo::map_id_char_to_number(char ch)
1290 {
1291 if ((ch == '0') || (ch == 'o') || (ch == 'O'))
1292 return 22;
1293@@ -917,7 +917,7 @@
1294 Return value: The converted value as a character
1295 ===============
1296 */
1297-char UniqueRandomMapInfo::mapIdNumberToChar(int32_t const num)
1298+char UniqueRandomMapInfo::map_id_number_to_char(int32_t const num)
1299 {
1300 if (num == 22)
1301 return '0';
1302@@ -950,7 +950,7 @@
1303 ===============
1304 */
1305
1306-bool UniqueRandomMapInfo::setFromIdString
1307+bool UniqueRandomMapInfo::set_from_id_string
1308 (UniqueRandomMapInfo & mapInfo_out, const std::string & mapIdString)
1309 {
1310 // check string
1311@@ -967,7 +967,7 @@
1312 int32_t nums[kMapIdDigits];
1313
1314 for (uint32_t ix = 0; ix < kMapIdDigits; ++ix) {
1315- int const num = mapIdCharToNumber(mapIdString[ix + (ix / 4)]);
1316+ int const num = map_id_char_to_number(mapIdString[ix + (ix / 4)]);
1317 if (num < 0)
1318 return false;
1319 nums[ix] = num;
1320@@ -1050,7 +1050,7 @@
1321 begin created (map specific info)
1322 ===============
1323 */
1324-void UniqueRandomMapInfo::generateIdString
1325+void UniqueRandomMapInfo::generate_id_string
1326 (std::string & mapIdsString_out, const UniqueRandomMapInfo & mapInfo)
1327 {
1328 // Init
1329@@ -1070,7 +1070,7 @@
1330 nums[ix] = 0;
1331
1332 // Generate world name hash
1333- uint16_t nameHash = generateWorldNameHash(mapInfo.world_name);
1334+ uint16_t nameHash = generate_world_name_hash(mapInfo.world_name);
1335
1336 // Convert map random number
1337 nums [0] = mapInfo.mapNumber & 31;
1338@@ -1134,14 +1134,14 @@
1339
1340 // translate it to ASCII
1341 for (uint32_t ix = 0; ix < kMapIdDigits; ++ix) {
1342- mapIdsString_out += mapIdNumberToChar(nums[ix]);
1343+ mapIdsString_out += map_id_number_to_char(nums[ix]);
1344 if (ix % 4 == 3 && ix != kMapIdDigits - 1)
1345 mapIdsString_out += "-";
1346 }
1347 }
1348
1349
1350-uint16_t Widelands::UniqueRandomMapInfo::generateWorldNameHash
1351+uint16_t Widelands::UniqueRandomMapInfo::generate_world_name_hash
1352 (const std::string & name)
1353 {
1354 // This is only a simple digest algorithm. Thats enough for our purposes.
1355
1356=== modified file 'src/editor/map_generator.h'
1357--- src/editor/map_generator.h 2014-09-10 10:18:46 +0000
1358+++ src/editor/map_generator.h 2014-09-29 14:39:47 +0000
1359@@ -63,15 +63,15 @@
1360 bool islandMode; // whether the world will be an island
1361
1362 // other stuff
1363- static bool setFromIdString
1364+ static bool set_from_id_string
1365 (UniqueRandomMapInfo & mapInfo_out, const std::string & mapIdString);
1366- static void generateIdString
1367+ static void generate_id_string
1368 (std::string & mapIdsString_out, const UniqueRandomMapInfo & mapInfo);
1369
1370 private:
1371- static int mapIdCharToNumber(char);
1372- static char mapIdNumberToChar(int32_t);
1373- static uint16_t generateWorldNameHash(const std::string &);
1374+ static int map_id_char_to_number(char);
1375+ static char map_id_number_to_char(int32_t);
1376+ static uint16_t generate_world_name_hash(const std::string &);
1377 };
1378
1379
1380
1381=== modified file 'src/editor/tools/editor_decrease_resources_tool.cc'
1382--- src/editor/tools/editor_decrease_resources_tool.cc 2014-09-10 14:08:25 +0000
1383+++ src/editor/tools/editor_decrease_resources_tool.cc 2014-09-29 14:39:47 +0000
1384@@ -57,7 +57,7 @@
1385 args.orgRes.push_back(mr.location().field->get_resources_amount());
1386
1387 if (res == args.cur_res &&
1388- Editor_Change_Resource_Tool_Callback(mr.location(), map, world, args.cur_res)) {
1389+ editor_change_resource_tool_callback(mr.location(), map, world, args.cur_res)) {
1390 // Ok, we're doing something. First remove the current overlays.
1391 std::string str =
1392 world.get_resource(res)->get_editor_pic
1393
1394=== modified file 'src/editor/tools/editor_increase_resources_tool.cc'
1395--- src/editor/tools/editor_increase_resources_tool.cc 2014-09-10 14:08:25 +0000
1396+++ src/editor/tools/editor_increase_resources_tool.cc 2014-09-29 14:39:47 +0000
1397@@ -46,7 +46,7 @@
1398 } // namespace
1399
1400
1401-int32_t Editor_Change_Resource_Tool_Callback
1402+int32_t editor_change_resource_tool_callback
1403 (const TCoords<Widelands::FCoords>& c, Widelands::Map& map,
1404 const Widelands::World& world, int32_t const curres)
1405 {
1406@@ -110,7 +110,7 @@
1407 if
1408 ((res == args.cur_res || !mr.location().field->get_resources_amount())
1409 &&
1410- Editor_Change_Resource_Tool_Callback(mr.location(), map, world, args.cur_res))
1411+ editor_change_resource_tool_callback(mr.location(), map, world, args.cur_res))
1412 {
1413 // Ok, we're doing something. First remove the current overlays.
1414 const Image* pic =
1415
1416=== modified file 'src/editor/tools/editor_increase_resources_tool.h'
1417--- src/editor/tools/editor_increase_resources_tool.h 2014-09-10 14:08:25 +0000
1418+++ src/editor/tools/editor_increase_resources_tool.h 2014-09-29 14:39:47 +0000
1419@@ -72,7 +72,7 @@
1420 Widelands::ResourceIndex m_cur_res;
1421 };
1422
1423-int32_t Editor_Change_Resource_Tool_Callback
1424+int32_t editor_change_resource_tool_callback
1425 (const Widelands::TCoords<Widelands::FCoords>& c, Widelands::Map& map,
1426 const Widelands::World& world, int32_t const curres);
1427
1428
1429=== modified file 'src/editor/tools/editor_make_infrastructure_tool.cc'
1430--- src/editor/tools/editor_make_infrastructure_tool.cc 2014-09-10 14:08:25 +0000
1431+++ src/editor/tools/editor_make_infrastructure_tool.cc 2014-09-29 14:39:47 +0000
1432@@ -31,7 +31,7 @@
1433 * Callback function to calculate correct overlays
1434 */
1435 int32_t
1436-Editor_Make_Infrastructure_Tool_Callback
1437+editor_make_infrastructure_tool_callback
1438 (const Widelands::TCoords<Widelands::FCoords>& c,
1439 Widelands::EditorGameBase& egbase,
1440 int32_t const player)
1441
1442=== modified file 'src/editor/tools/editor_make_infrastructure_tool.h'
1443--- src/editor/tools/editor_make_infrastructure_tool.h 2014-09-10 14:08:25 +0000
1444+++ src/editor/tools/editor_make_infrastructure_tool.h 2014-09-29 14:39:47 +0000
1445@@ -53,7 +53,7 @@
1446 UI::UniqueWindow::Registry m_registry;
1447 };
1448
1449-int32_t Editor_Make_Infrastructure_Tool_Callback
1450+int32_t editor_make_infrastructure_tool_callback
1451 (const Widelands::TCoords<Widelands::FCoords>& c,
1452 Widelands::EditorGameBase& egbase, int32_t const player);
1453
1454
1455=== modified file 'src/editor/tools/editor_set_port_space_tool.cc'
1456--- src/editor/tools/editor_set_port_space_tool.cc 2014-09-10 14:08:25 +0000
1457+++ src/editor/tools/editor_set_port_space_tool.cc 2014-09-29 14:39:47 +0000
1458@@ -30,7 +30,7 @@
1459 using namespace Widelands;
1460
1461 /// static callback function for overlay calculation
1462-int32_t Editor_Tool_Set_Port_Space_Callback
1463+int32_t editor_Tool_set_port_space_callback
1464 (const Widelands::TCoords<Widelands::FCoords>& c, Map& map)
1465 {
1466 NodeCaps const caps = c.field->nodecaps();
1467@@ -71,7 +71,7 @@
1468 (map, Widelands::Area<Widelands::FCoords>(map.get_fcoords(center.node), args.sel_radius));
1469 do {
1470 // check if field is valid
1471- if (Editor_Tool_Set_Port_Space_Callback(mr.location(), map)) {
1472+ if (editor_Tool_set_port_space_callback(mr.location(), map)) {
1473 map.set_port_space(mr.location(), true);
1474 Area<FCoords> a(mr.location(), 0);
1475 map.recalc_for_field_area(world, a);
1476@@ -106,7 +106,7 @@
1477 (map, Widelands::Area<Widelands::FCoords>(map.get_fcoords(center.node), args.sel_radius));
1478 do {
1479 // check if field is valid
1480- if (Editor_Tool_Set_Port_Space_Callback(mr.location(), map)) {
1481+ if (editor_Tool_set_port_space_callback(mr.location(), map)) {
1482 map.set_port_space(mr.location(), false);
1483 Area<FCoords> a(mr.location(), 0);
1484 map.recalc_for_field_area(world, a);
1485
1486=== modified file 'src/editor/tools/editor_set_port_space_tool.h'
1487--- src/editor/tools/editor_set_port_space_tool.h 2014-09-10 14:08:25 +0000
1488+++ src/editor/tools/editor_set_port_space_tool.h 2014-09-29 14:39:47 +0000
1489@@ -67,7 +67,7 @@
1490 char const * get_sel_impl() const override {return FSEL_ESPS_FILENAME;}
1491 };
1492
1493-int32_t Editor_Tool_Set_Port_Space_Callback
1494+int32_t editor_Tool_set_port_space_callback
1495 (const Widelands::TCoords<Widelands::FCoords>& c, Widelands::Map& map);
1496
1497 #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_SET_PORT_SPACE_TOOL_H
1498
1499=== modified file 'src/editor/tools/editor_set_resources_tool.cc'
1500--- src/editor/tools/editor_set_resources_tool.cc 2014-09-10 14:08:25 +0000
1501+++ src/editor/tools/editor_set_resources_tool.cc 2014-09-29 14:39:47 +0000
1502@@ -55,7 +55,7 @@
1503 args.orgResT.push_back(res);
1504 args.orgRes.push_back(mr.location().field->get_resources_amount());
1505
1506- if (Editor_Change_Resource_Tool_Callback(mr.location(), map, world, args.cur_res)) {
1507+ if (editor_change_resource_tool_callback(mr.location(), map, world, args.cur_res)) {
1508 // Ok, we're doing something. First remove the current overlays.
1509 const Image* pic = g_gr->images().get
1510 (world.get_resource(res)->get_editor_pic (mr.location().field->get_resources_amount()));
1511
1512=== modified file 'src/editor/tools/editor_set_starting_pos_tool.cc'
1513--- src/editor/tools/editor_set_starting_pos_tool.cc 2014-09-10 14:08:25 +0000
1514+++ src/editor/tools/editor_set_starting_pos_tool.cc 2014-09-29 14:39:47 +0000
1515@@ -32,7 +32,7 @@
1516 /*
1517 * static callback function for overlay calculation
1518 */
1519-int32_t Editor_Tool_Set_Starting_Pos_Callback
1520+int32_t editor_tool_set_starting_pos_callback
1521 (const Widelands::TCoords<Widelands::FCoords>& c, Widelands::Map& map)
1522 {
1523 // Area around already placed players
1524@@ -88,7 +88,7 @@
1525 const Image* pic = g_gr->images().get(picname);
1526
1527 // check if field is valid
1528- if (Editor_Tool_Set_Starting_Pos_Callback(map.get_fcoords(center.node), map)) {
1529+ if (editor_tool_set_starting_pos_callback(map.get_fcoords(center.node), map)) {
1530 OverlayManager & overlay_manager = map.overlay_manager();
1531 // remove old overlay if any
1532 overlay_manager.remove_overlay(old_sp, pic);
1533
1534=== modified file 'src/editor/tools/editor_set_starting_pos_tool.h'
1535--- src/editor/tools/editor_set_starting_pos_tool.h 2014-09-10 14:08:25 +0000
1536+++ src/editor/tools/editor_set_starting_pos_tool.h 2014-09-29 14:39:47 +0000
1537@@ -51,7 +51,7 @@
1538 char const * m_current_sel_pic;
1539 };
1540
1541-int32_t Editor_Tool_Set_Starting_Pos_Callback
1542+int32_t editor_tool_set_starting_pos_callback
1543 (const Widelands::TCoords<Widelands::FCoords>& c, Widelands::Map& map);
1544
1545 #endif // end of include guard: WL_EDITOR_TOOLS_EDITOR_SET_STARTING_POS_TOOL_H
1546
1547=== modified file 'src/editor/ui_menus/editor_main_menu_load_map.cc'
1548--- src/editor/ui_menus/editor_main_menu_load_map.cc 2014-09-23 09:26:48 +0000
1549+++ src/editor/ui_menus/editor_main_menu_load_map.cc 2014-09-29 14:39:47 +0000
1550@@ -138,7 +138,7 @@
1551 void MainMenuLoadMap::clicked_ok() {
1552 const char * const filename(m_ls->get_selected());
1553
1554- if (g_fs->IsDirectory(filename) && !WidelandsMapLoader::is_widelands_map(filename)) {
1555+ if (g_fs->is_directory(filename) && !WidelandsMapLoader::is_widelands_map(filename)) {
1556 m_curdir = filename;
1557 m_ls->clear();
1558 m_mapfiles.clear();
1559@@ -157,7 +157,7 @@
1560
1561 m_ok_btn->set_enabled(true);
1562
1563- if (!g_fs->IsDirectory(name) || WidelandsMapLoader::is_widelands_map(name)) {
1564+ if (!g_fs->is_directory(name) || WidelandsMapLoader::is_widelands_map(name)) {
1565 Widelands::Map map;
1566 {
1567 std::unique_ptr<Widelands::MapLoader> map_loader = map.get_correct_loader(name);
1568@@ -196,7 +196,7 @@
1569 */
1570 void MainMenuLoadMap::fill_list() {
1571 // Fill it with all files we find.
1572- m_mapfiles = g_fs->ListDirectory(m_curdir);
1573+ m_mapfiles = g_fs->list_directory(m_curdir);
1574
1575 // First, we add all directories. We manually add the parent directory.
1576 if (m_curdir != m_basedir) {
1577@@ -222,13 +222,13 @@
1578 {
1579 const char * const name = pname->c_str();
1580 if
1581- (strcmp(FileSystem::FS_Filename(name), ".") &&
1582- strcmp(FileSystem::FS_Filename(name), "..") &&
1583- g_fs->IsDirectory(name) &&
1584+ (strcmp(FileSystem::fs_filename(name), ".") &&
1585+ strcmp(FileSystem::fs_filename(name), "..") &&
1586+ g_fs->is_directory(name) &&
1587 !WidelandsMapLoader::is_widelands_map(name))
1588
1589 m_ls->add
1590- (FileSystem::FS_Filename(name),
1591+ (FileSystem::fs_filename(name),
1592 name,
1593 g_gr->images().get("pics/ls_dir.png"));
1594 }
1595@@ -246,7 +246,7 @@
1596 try {
1597 map_loader->preload_map(true);
1598 m_ls->add
1599- (FileSystem::FS_Filename(name),
1600+ (FileSystem::fs_filename(name),
1601 name,
1602 g_gr->images().get
1603 (dynamic_cast<WidelandsMapLoader*>(map_loader.get())
1604
1605=== modified file 'src/editor/ui_menus/editor_main_menu_map_options.cc'
1606--- src/editor/ui_menus/editor_main_menu_map_options.cc 2014-09-10 14:48:40 +0000
1607+++ src/editor/ui_menus/editor_main_menu_map_options.cc 2014-09-29 14:39:47 +0000
1608@@ -116,8 +116,8 @@
1609 char buf[200];
1610 sprintf(buf, "%ix%i", map.get_width(), map.get_height());
1611 m_size->set_text(buf);
1612- m_author->setText(map.get_author());
1613- m_name ->setText(map.get_name());
1614+ m_author->set_text(map.get_author());
1615+ m_name ->set_text(map.get_name());
1616 sprintf(buf, "%i", map.get_nrplayers());
1617 m_nrplayers->set_text(buf);
1618 m_descr ->set_text(map.get_description());
1619
1620=== modified file 'src/editor/ui_menus/editor_main_menu_random_map.cc'
1621--- src/editor/ui_menus/editor_main_menu_random_map.cc 2014-09-14 12:13:35 +0000
1622+++ src/editor/ui_menus/editor_main_menu_random_map.cc 2014-09-29 14:39:47 +0000
1623@@ -90,7 +90,7 @@
1624 m_mapNumber = rng.rand();
1625 snprintf
1626 (buffer, sizeof(buffer), "%u", static_cast<unsigned int>(m_mapNumber));
1627- m_nrEditbox->setText(buffer);
1628+ m_nrEditbox->set_text(buffer);
1629 posy += height + spacing + spacing + spacing;
1630
1631
1632@@ -297,7 +297,7 @@
1633 posx, posy,
1634 width, 20,
1635 g_gr->images().get("pics/but1.png"));
1636- m_idEditbox->setText("abcd-efgh-ijkl-mnop");
1637+ m_idEditbox->set_text("abcd-efgh-ijkl-mnop");
1638 m_idEditbox->changed.connect
1639 (boost::bind(&MainMenuNewRandomMap::id_edit_box_changed, this));
1640 posy += height + spacing + spacing + spacing;
1641@@ -499,12 +499,12 @@
1642
1643 std::string str = m_idEditbox->text();
1644
1645- if (!UniqueRandomMapInfo::setFromIdString(mapInfo, str))
1646+ if (!UniqueRandomMapInfo::set_from_id_string(mapInfo, str))
1647 m_goButton->set_enabled(false);
1648 else {
1649 std::stringstream sstrm;
1650 sstrm << mapInfo.mapNumber;
1651- m_nrEditbox->setText(sstrm.str());
1652+ m_nrEditbox->set_text(sstrm.str());
1653
1654 m_h = 0;
1655 for (uint32_t ix = 0; ix < NUMBER_OF_MAP_DIMENSIONS; ++ix)
1656@@ -545,9 +545,9 @@
1657 set_map_info(mapInfo);
1658
1659 std::string idStr;
1660- Widelands::UniqueRandomMapInfo::generateIdString(idStr, mapInfo);
1661+ Widelands::UniqueRandomMapInfo::generate_id_string(idStr, mapInfo);
1662
1663- m_idEditbox->setText(idStr);
1664+ m_idEditbox->set_text(idStr);
1665
1666 m_goButton->set_enabled(true);
1667 } else
1668
1669=== modified file 'src/editor/ui_menus/editor_main_menu_save_map.cc'
1670--- src/editor/ui_menus/editor_main_menu_save_map.cc 2014-09-23 09:26:48 +0000
1671+++ src/editor/ui_menus/editor_main_menu_save_map.cc 2014-09-29 14:39:47 +0000
1672@@ -73,7 +73,7 @@
1673 posx, posy + get_inner_h() - spacing - offsy - 60 + 3,
1674 get_inner_w() / 2 - spacing, 20,
1675 g_gr->images().get("pics/but1.png"));
1676- m_editbox->setText(parent.egbase().map().get_name());
1677+ m_editbox->set_text(parent.egbase().map().get_name());
1678 m_editbox->changed.connect(boost::bind(&MainMenuSaveMap::edit_box_changed, this));
1679
1680 posx = get_inner_w() / 2 + spacing;
1681@@ -164,11 +164,11 @@
1682 filename = m_ls->get_selected();
1683
1684 if
1685- (g_fs->IsDirectory(filename.c_str())
1686+ (g_fs->is_directory(filename.c_str())
1687 &&
1688 !Widelands::WidelandsMapLoader::is_widelands_map(filename))
1689 {
1690- m_curdir = g_fs->FS_CanonicalizeName(filename);
1691+ m_curdir = g_fs->canonicalize_name(filename);
1692 m_ls->clear();
1693 m_mapfiles.clear();
1694 fill_list();
1695@@ -200,12 +200,12 @@
1696 void MainMenuSaveMap::clicked_make_directory() {
1697 MainMenuSaveMapMakeDirectory md(this, _("unnamed"));
1698 if (md.run()) {
1699- g_fs->EnsureDirectoryExists(m_basedir);
1700+ g_fs->ensure_directory_exists(m_basedir);
1701 // create directory
1702 std::string fullname = m_curdir;
1703 fullname += "/";
1704 fullname += md.get_dirname();
1705- g_fs->MakeDirectory(fullname);
1706+ g_fs->make_directory(fullname);
1707 m_ls->clear();
1708 m_mapfiles.clear();
1709 fill_list();
1710@@ -226,7 +226,7 @@
1711 ml->preload_map(true); // This has worked before, no problem
1712 }
1713
1714- m_editbox->setText(FileSystem::FS_Filename(name));
1715+ m_editbox->set_text(FileSystem::fs_filename(name));
1716
1717 m_name ->set_text(map.get_name ());
1718 m_author->set_text(map.get_author ());
1719@@ -239,11 +239,11 @@
1720 sprintf(buf, "%ix%i", map.get_width(), map.get_height());
1721 m_size->set_text(buf);
1722 } else {
1723- m_name ->set_text(FileSystem::FS_Filename(name));
1724+ m_name ->set_text(FileSystem::fs_filename(name));
1725 m_author ->set_text("");
1726 m_nrplayers->set_text("");
1727 m_size ->set_text("");
1728- if (g_fs->IsDirectory(name)) {
1729+ if (g_fs->is_directory(name)) {
1730 std::string dir_string =
1731 (boost::format("\\<%s\\>") % _("directory")).str();
1732 m_descr ->set_text(dir_string);
1733@@ -263,7 +263,7 @@
1734 void MainMenuSaveMap::double_clicked_item(uint32_t) {
1735 const char * const name = m_ls->get_selected();
1736
1737- if (g_fs->IsDirectory(name) && !Widelands::WidelandsMapLoader::is_widelands_map(name)) {
1738+ if (g_fs->is_directory(name) && !Widelands::WidelandsMapLoader::is_widelands_map(name)) {
1739 m_curdir = name;
1740 m_ls->clear();
1741 m_mapfiles.clear();
1742@@ -277,7 +277,7 @@
1743 */
1744 void MainMenuSaveMap::fill_list() {
1745 // Fill it with all files we find.
1746- m_mapfiles = g_fs->ListDirectory(m_curdir);
1747+ m_mapfiles = g_fs->list_directory(m_curdir);
1748
1749 // First, we add all directories. We manually add the parent directory
1750 if (m_curdir != m_basedir) {
1751@@ -303,13 +303,13 @@
1752 {
1753 const char * const name = pname->c_str();
1754 if
1755- (strcmp(FileSystem::FS_Filename(name), ".") &&
1756- strcmp(FileSystem::FS_Filename(name), "..") &&
1757- g_fs->IsDirectory(name) &&
1758+ (strcmp(FileSystem::fs_filename(name), ".") &&
1759+ strcmp(FileSystem::fs_filename(name), "..") &&
1760+ g_fs->is_directory(name) &&
1761 !Widelands::WidelandsMapLoader::is_widelands_map(name))
1762
1763 m_ls->add
1764- (FileSystem::FS_Filename(name),
1765+ (FileSystem::fs_filename(name),
1766 name,
1767 g_gr->images().get("pics/ls_dir.png"));
1768 }
1769@@ -329,7 +329,7 @@
1770 try {
1771 wml->preload_map(true);
1772 m_ls->add
1773- (FileSystem::FS_Filename(name),
1774+ (FileSystem::fs_filename(name),
1775 name,
1776 g_gr->images().get("pics/ls_wlmap.png"));
1777 } catch (const WException &) {} // we simply skip illegal entries
1778@@ -355,7 +355,7 @@
1779 */
1780 bool MainMenuSaveMap::save_map(std::string filename, bool binary) {
1781 // Make sure that the base directory exists.
1782- g_fs->EnsureDirectoryExists(m_basedir);
1783+ g_fs->ensure_directory_exists(m_basedir);
1784
1785 // OK, first check if the extension matches (ignoring case).
1786 bool assign_extension = true;
1787@@ -375,20 +375,20 @@
1788 complete_filename += filename;
1789
1790 // Check if file exists. If so, show a warning.
1791- if (g_fs->FileExists(complete_filename)) {
1792+ if (g_fs->file_exists(complete_filename)) {
1793 std::string s =
1794 (boost::format(_("A file with the name ‘%s’ already exists. Overwrite?"))
1795- % FileSystem::FS_Filename(filename.c_str())).str();
1796+ % FileSystem::fs_filename(filename.c_str())).str();
1797 UI::WLMessageBox mbox
1798 (&eia(), _("Error Saving Map!"), s, UI::WLMessageBox::YESNO);
1799 if (!mbox.run())
1800 return false;
1801
1802- g_fs->Unlink(complete_filename);
1803+ g_fs->fs_unlink(complete_filename);
1804 }
1805
1806 std::unique_ptr<FileSystem> fs
1807- (g_fs->CreateSubFileSystem(complete_filename, binary ? FileSystem::ZIP : FileSystem::DIR));
1808+ (g_fs->create_sub_file_system(complete_filename, binary ? FileSystem::ZIP : FileSystem::DIR));
1809 Widelands::MapSaver wms(*fs, eia().egbase());
1810 try {
1811 wms.save();
1812
1813=== modified file 'src/editor/ui_menus/editor_main_menu_save_map_make_directory.cc'
1814--- src/editor/ui_menus/editor_main_menu_save_map_make_directory.cc 2014-09-10 14:08:25 +0000
1815+++ src/editor/ui_menus/editor_main_menu_save_map_make_directory.cc 2014-09-29 14:39:47 +0000
1816@@ -42,7 +42,7 @@
1817 new UI::EditBox
1818 (this, spacing, posy, get_inner_w() - 2 * spacing, 20,
1819 g_gr->images().get("pics/but1.png"));
1820- m_edit->setText(dirname);
1821+ m_edit->set_text(dirname);
1822 m_dirname = dirname;
1823 m_edit->changed.connect(boost::bind(&MainMenuSaveMapMakeDirectory::edit_changed, this));
1824
1825
1826=== modified file 'src/editor/ui_menus/editor_player_menu.cc'
1827--- src/editor/ui_menus/editor_player_menu.cc 2014-09-10 14:08:25 +0000
1828+++ src/editor/ui_menus/editor_player_menu.cc 2014-09-29 14:39:47 +0000
1829@@ -147,7 +147,7 @@
1830 m_plr_names[p - 1]->changed.connect
1831 (boost::bind(&EditorPlayerMenu::name_changed, this, p - 1));
1832 posx += 140 + spacing;
1833- m_plr_names[p - 1]->setText(map.get_scenario_player_name(p));
1834+ m_plr_names[p - 1]->set_text(map.get_scenario_player_name(p));
1835 }
1836
1837 if (!m_plr_set_tribes_buts[p - 1]) {
1838@@ -356,7 +356,7 @@
1839 // Register callback function to make sure that only valid locations are
1840 // selected.
1841 map.overlay_manager().register_overlay_callback_function(
1842- boost::bind(&Editor_Tool_Set_Starting_Pos_Callback, _1, boost::ref(map)));
1843+ boost::bind(&editor_tool_set_starting_pos_callback, _1, boost::ref(map)));
1844 map.recalc_whole_map(menu.egbase().world());
1845 update();
1846 }
1847@@ -372,10 +372,10 @@
1848 Widelands::Map & map = menu.egbase().map();
1849 if (text == "") {
1850 text = map.get_scenario_player_name(m + 1);
1851- m_plr_names[m]->setText(text);
1852+ m_plr_names[m]->set_text(text);
1853 }
1854 map.set_scenario_player_name(m + 1, text);
1855- m_plr_names[m]->setText(map.get_scenario_player_name(m + 1));
1856+ m_plr_names[m]->set_text(map.get_scenario_player_name(m + 1));
1857 menu.set_need_save(true);
1858 }
1859
1860@@ -441,6 +441,6 @@
1861 parent.select_tool(parent.tools.make_infrastructure, EditorTool::First);
1862 parent.tools.make_infrastructure.set_player(n);
1863 overlay_manager.register_overlay_callback_function(
1864- boost::bind(&Editor_Make_Infrastructure_Tool_Callback, _1, boost::ref(egbase), n));
1865+ boost::bind(&editor_make_infrastructure_tool_callback, _1, boost::ref(egbase), n));
1866 map.recalc_whole_map(egbase.world());
1867 }
1868
1869=== modified file 'src/editor/ui_menus/editor_tool_change_resources_options_menu.cc'
1870--- src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2014-09-10 14:08:25 +0000
1871+++ src/editor/ui_menus/editor_tool_change_resources_options_menu.cc 2014-09-29 14:39:47 +0000
1872@@ -215,7 +215,7 @@
1873 Widelands::EditorGameBase& egbase = ref_cast<EditorInteractive, UI::Panel>(*get_parent()).egbase();
1874 Widelands::Map & map = egbase.map();
1875 map.overlay_manager().register_overlay_callback_function(
1876- boost::bind(&Editor_Change_Resource_Tool_Callback, _1, boost::ref(map), boost::ref(egbase.world()), n));
1877+ boost::bind(&editor_change_resource_tool_callback, _1, boost::ref(map), boost::ref(egbase.world()), n));
1878 map.recalc_whole_map(egbase.world());
1879 select_correct_tool();
1880
1881
1882=== modified file 'src/editor/ui_menus/editor_tool_menu.cc'
1883--- src/editor/ui_menus/editor_tool_menu.cc 2014-09-10 14:08:25 +0000
1884+++ src/editor/ui_menus/editor_tool_menu.cc 2014-09-29 14:39:47 +0000
1885@@ -142,7 +142,7 @@
1886 // Set correct overlay
1887 Widelands::Map & map = parent.egbase().map();
1888 map.overlay_manager().register_overlay_callback_function(
1889- boost::bind(&Editor_Tool_Set_Port_Space_Callback, _1, boost::ref(map)));
1890+ boost::bind(&editor_Tool_set_port_space_callback, _1, boost::ref(map)));
1891 map.recalc_whole_map(parent.egbase().world());
1892 update();
1893 }
1894
1895=== modified file 'src/game_io/game_class_packet.cc'
1896--- src/game_io/game_class_packet.cc 2014-09-10 08:55:04 +0000
1897+++ src/game_io/game_class_packet.cc 2014-09-29 14:39:47 +0000
1898@@ -29,16 +29,16 @@
1899 #define CURRENT_PACKET_VERSION 2
1900
1901
1902-void GameClassPacket::Read
1903+void GameClassPacket::read
1904 (FileSystem & fs, Game & game, MapObjectLoader *)
1905 {
1906 try {
1907 FileRead fr;
1908- fr.Open(fs, "binary/game_class");
1909- uint16_t const packet_version = fr.Unsigned16();
1910+ fr.open(fs, "binary/game_class");
1911+ uint16_t const packet_version = fr.unsigned_16();
1912 if (packet_version <= CURRENT_PACKET_VERSION) {
1913- fr.Signed16(); // This used to be game speed
1914- game.gametime_ = fr.Unsigned32();
1915+ fr.signed_16(); // This used to be game speed
1916+ game.gametime_ = fr.unsigned_32();
1917 } else
1918 throw GameDataError
1919 ("unknown/unhandled version %u", packet_version);
1920@@ -50,17 +50,17 @@
1921 /*
1922 * Write Function
1923 */
1924-void GameClassPacket::Write
1925+void GameClassPacket::write
1926 (FileSystem & fs, Game & game, MapObjectSaver * const)
1927 {
1928 FileWrite fw;
1929
1930 // Packet version
1931- fw.Unsigned16(CURRENT_PACKET_VERSION);
1932+ fw.unsigned_16(CURRENT_PACKET_VERSION);
1933
1934 // State is running, we do not need to save this
1935 // Save speed
1936- fw.Signed16(1000);
1937+ fw.signed_16(1000);
1938
1939 // From the interactive player, is saved somewhere else
1940 // Computer players are saved somewhere else
1941@@ -70,7 +70,7 @@
1942
1943 // EDITOR GAME CLASS
1944 // Write gametime
1945- fw.Unsigned32(game.gametime_);
1946+ fw.unsigned_32(game.gametime_);
1947
1948 // We do not care for players, since they were set
1949 // on game initialization to match Map::scenario_player_[names|tribes]
1950@@ -85,7 +85,7 @@
1951
1952 // Track pointers are not saved in save games
1953
1954- fw.Write(fs, "binary/game_class");
1955+ fw.write(fs, "binary/game_class");
1956 }
1957
1958 }
1959
1960=== modified file 'src/game_io/game_class_packet.h'
1961--- src/game_io/game_class_packet.h 2014-09-10 16:57:31 +0000
1962+++ src/game_io/game_class_packet.h 2014-09-29 14:39:47 +0000
1963@@ -29,8 +29,8 @@
1964 * a game for a user (for example in a listbox)
1965 */
1966 struct GameClassPacket : public GameDataPacket {
1967- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
1968- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
1969+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
1970+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
1971 };
1972
1973 }
1974
1975=== modified file 'src/game_io/game_cmd_queue_packet.cc'
1976--- src/game_io/game_cmd_queue_packet.cc 2014-09-14 16:08:13 +0000
1977+++ src/game_io/game_cmd_queue_packet.cc 2014-09-29 14:39:47 +0000
1978@@ -32,47 +32,47 @@
1979 #define CURRENT_PACKET_VERSION 2
1980
1981
1982-void GameCmdQueuePacket::Read
1983+void GameCmdQueuePacket::read
1984 (FileSystem & fs, Game & game, MapObjectLoader * const ol)
1985 {
1986 try {
1987 FileRead fr;
1988- fr.Open(fs, "binary/cmd_queue");
1989- uint16_t const packet_version = fr.Unsigned16();
1990+ fr.open(fs, "binary/cmd_queue");
1991+ uint16_t const packet_version = fr.unsigned_16();
1992 if (packet_version == CURRENT_PACKET_VERSION) {
1993 CmdQueue & cmdq = game.cmdqueue();
1994
1995 // nothing to be done for m_game
1996
1997 // Next serial
1998- cmdq.nextserial = fr.Unsigned32();
1999+ cmdq.nextserial = fr.unsigned_32();
2000
2001 // Erase all currently pending commands in the queue
2002 cmdq.flush();
2003
2004 for (;;) {
2005- uint32_t const packet_id = fr.Unsigned16();
2006+ uint32_t const packet_id = fr.unsigned_16();
2007
2008 if (!packet_id)
2009 break;
2010
2011 CmdQueue::CmdItem item;
2012- item.category = fr.Signed32();
2013- item.serial = fr.Unsigned32();
2014+ item.category = fr.signed_32();
2015+ item.serial = fr.unsigned_32();
2016
2017 if (packet_id == 129) {
2018 // For backwards compatibility with savegames up to build15:
2019 // Discard old CheckEventChain commands
2020- fr.Unsigned16(); // CheckEventChain version
2021- fr.Unsigned16(); // GameLogicCommand version
2022- fr.Unsigned32(); // GameLogicCommand duetime
2023- fr.Unsigned16(); // CheckEventChain ID
2024+ fr.unsigned_16(); // CheckEventChain version
2025+ fr.unsigned_16(); // GameLogicCommand version
2026+ fr.unsigned_32(); // GameLogicCommand duetime
2027+ fr.unsigned_16(); // CheckEventChain ID
2028 continue;
2029 }
2030
2031 GameLogicCommand & cmd =
2032 QueueCmdFactory::create_correct_queue_command(packet_id);
2033- cmd.Read(fr, game, *ol);
2034+ cmd.read(fr, game, *ol);
2035
2036 item.cmd = &cmd;
2037
2038@@ -88,20 +88,20 @@
2039 }
2040
2041
2042-void GameCmdQueuePacket::Write
2043+void GameCmdQueuePacket::write
2044 (FileSystem & fs, Game & game, MapObjectSaver * const os)
2045 {
2046 FileWrite fw;
2047
2048 // Now packet version
2049- fw.Unsigned16(CURRENT_PACKET_VERSION);
2050+ fw.unsigned_16(CURRENT_PACKET_VERSION);
2051
2052 const CmdQueue & cmdq = game.cmdqueue();
2053
2054 // nothing to be done for m_game
2055
2056 // Next serial
2057- fw.Unsigned32(cmdq.nextserial);
2058+ fw.unsigned_32(cmdq.nextserial);
2059
2060 // Write all commands
2061
2062@@ -118,14 +118,14 @@
2063 if (it.cmd->duetime() == time) {
2064 if (upcast(GameLogicCommand, cmd, it.cmd)) {
2065 // The id (aka command type)
2066- fw.Unsigned16(cmd->id());
2067+ fw.unsigned_16(cmd->id());
2068
2069 // Serial number
2070- fw.Signed32(it.category);
2071- fw.Unsigned32(it.serial);
2072+ fw.signed_32(it.category);
2073+ fw.unsigned_32(it.serial);
2074
2075 // Now the command itself
2076- cmd->Write(fw, game, *os);
2077+ cmd->write(fw, game, *os);
2078 }
2079 ++ nhandled;
2080 }
2081@@ -137,9 +137,9 @@
2082 }
2083
2084
2085- fw.Unsigned16(0); // end of command queue
2086+ fw.unsigned_16(0); // end of command queue
2087
2088- fw.Write(fs, "binary/cmd_queue");
2089+ fw.write(fs, "binary/cmd_queue");
2090 }
2091
2092 }
2093
2094=== modified file 'src/game_io/game_cmd_queue_packet.h'
2095--- src/game_io/game_cmd_queue_packet.h 2014-09-10 16:57:31 +0000
2096+++ src/game_io/game_cmd_queue_packet.h 2014-09-29 14:39:47 +0000
2097@@ -31,8 +31,8 @@
2098 * a game for a user (for example in a listbox)
2099 */
2100 struct GameCmdQueuePacket : public GameDataPacket {
2101- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2102- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2103+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2104+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2105 };
2106
2107 }
2108
2109=== modified file 'src/game_io/game_data_packet.h'
2110--- src/game_io/game_data_packet.h 2014-09-10 07:57:29 +0000
2111+++ src/game_io/game_data_packet.h 2014-09-29 14:39:47 +0000
2112@@ -40,8 +40,8 @@
2113 */
2114 struct GameDataPacket {
2115 virtual ~GameDataPacket() {}
2116- virtual void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) = 0;
2117- virtual void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) = 0;
2118+ virtual void read (FileSystem &, Game &, MapObjectLoader * = nullptr) = 0;
2119+ virtual void write(FileSystem &, Game &, MapObjectSaver * = nullptr) = 0;
2120 };
2121
2122 }
2123
2124=== modified file 'src/game_io/game_interactive_player_packet.cc'
2125--- src/game_io/game_interactive_player_packet.cc 2014-09-10 13:03:40 +0000
2126+++ src/game_io/game_interactive_player_packet.cc 2014-09-29 14:39:47 +0000
2127@@ -34,15 +34,15 @@
2128 #define CURRENT_PACKET_VERSION 2
2129
2130
2131-void GameInteractivePlayerPacket::Read
2132+void GameInteractivePlayerPacket::read
2133 (FileSystem & fs, Game & game, MapObjectLoader *)
2134 {
2135 try {
2136 FileRead fr;
2137- fr.Open(fs, "binary/interactive_player");
2138- uint16_t const packet_version = fr.Unsigned16();
2139+ fr.open(fs, "binary/interactive_player");
2140+ uint16_t const packet_version = fr.unsigned_16();
2141 if (packet_version == CURRENT_PACKET_VERSION) {
2142- PlayerNumber player_number = fr.Unsigned8();
2143+ PlayerNumber player_number = fr.unsigned_8();
2144 if (!(0 < player_number && player_number <= game.map().get_nrplayers())) {
2145 throw GameDataError("Invalid player number: %i.", player_number);
2146 }
2147@@ -59,9 +59,9 @@
2148 if (player_number > max)
2149 throw GameDataError("The game has no players!");
2150 }
2151- int32_t const x = fr.Unsigned16();
2152- int32_t const y = fr.Unsigned16();
2153- uint32_t const display_flags = fr.Unsigned32();
2154+ int32_t const x = fr.unsigned_16();
2155+ int32_t const y = fr.unsigned_16();
2156+ uint32_t const display_flags = fr.unsigned_32();
2157
2158 if (InteractiveBase * const ibase = game.get_ibase()) {
2159 ibase->set_viewpoint(Point(x, y), true);
2160@@ -88,32 +88,32 @@
2161 /*
2162 * Write Function
2163 */
2164-void GameInteractivePlayerPacket::Write
2165+void GameInteractivePlayerPacket::write
2166 (FileSystem & fs, Game & game, MapObjectSaver * const)
2167 {
2168 FileWrite fw;
2169
2170 // Now packet version
2171- fw.Unsigned16(CURRENT_PACKET_VERSION);
2172+ fw.unsigned_16(CURRENT_PACKET_VERSION);
2173
2174 InteractiveBase * const ibase = game.get_ibase();
2175 InteractivePlayer * const iplayer = game.get_ipl();
2176
2177 // Player number
2178- fw.Unsigned8(iplayer ? iplayer->player_number() : 1);
2179+ fw.unsigned_8(iplayer ? iplayer->player_number() : 1);
2180
2181 // Map Position
2182 if (ibase) {
2183 assert(0 <= ibase->get_viewpoint().x);
2184 assert(0 <= ibase->get_viewpoint().y);
2185 }
2186- fw.Unsigned16(ibase ? ibase->get_viewpoint().x : 0);
2187- fw.Unsigned16(ibase ? ibase->get_viewpoint().y : 0);
2188+ fw.unsigned_16(ibase ? ibase->get_viewpoint().x : 0);
2189+ fw.unsigned_16(ibase ? ibase->get_viewpoint().y : 0);
2190
2191 // Display flags
2192- fw.Unsigned32(ibase ? ibase->get_display_flags() : 0);
2193+ fw.unsigned_32(ibase ? ibase->get_display_flags() : 0);
2194
2195- fw.Write(fs, "binary/interactive_player");
2196+ fw.write(fs, "binary/interactive_player");
2197 }
2198
2199 }
2200
2201=== modified file 'src/game_io/game_interactive_player_packet.h'
2202--- src/game_io/game_interactive_player_packet.h 2014-09-10 16:57:31 +0000
2203+++ src/game_io/game_interactive_player_packet.h 2014-09-29 14:39:47 +0000
2204@@ -29,8 +29,8 @@
2205 * player number and so on
2206 */
2207 struct GameInteractivePlayerPacket : public GameDataPacket {
2208- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2209- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2210+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2211+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2212 };
2213
2214 }
2215
2216=== modified file 'src/game_io/game_loader.cc'
2217--- src/game_io/game_loader.cc 2014-09-18 18:56:20 +0000
2218+++ src/game_io/game_loader.cc 2014-09-29 14:39:47 +0000
2219@@ -39,7 +39,7 @@
2220 namespace Widelands {
2221
2222 GameLoader::GameLoader(const std::string & path, Game & game) :
2223- m_fs(*g_fs->MakeSubFileSystem(path)), m_game(game)
2224+ m_fs(*g_fs->make_sub_file_system(path)), m_game(game)
2225 {}
2226
2227
2228@@ -52,7 +52,7 @@
2229 */
2230 int32_t GameLoader::preload_game(GamePreloadPacket & mp) {
2231 // Load elemental data block
2232- mp.Read(m_fs, m_game, nullptr);
2233+ mp.read(m_fs, m_game, nullptr);
2234
2235 return 0;
2236 }
2237@@ -64,33 +64,33 @@
2238 ScopedTimer timer("GameLoader::load() took %ums");
2239
2240 log("Game: Reading Preload Data ... ");
2241- {GamePreloadPacket p; p.Read(m_fs, m_game);}
2242+ {GamePreloadPacket p; p.read(m_fs, m_game);}
2243 log("took %ums\n", timer.ms_since_last_query());
2244
2245 log("Game: Reading Game Class Data ... ");
2246- {GameClassPacket p; p.Read(m_fs, m_game);}
2247+ {GameClassPacket p; p.read(m_fs, m_game);}
2248 log("took %ums\n", timer.ms_since_last_query());
2249
2250 log("Game: Reading Map Data ... ");
2251- GameMapPacket M; M.Read(m_fs, m_game);
2252+ GameMapPacket M; M.read(m_fs, m_game);
2253 log("Game: Reading Map Data took %ums\n", timer.ms_since_last_query());
2254
2255 log("Game: Reading Player Info ... ");
2256- {GamePlayerInfoPacket p; p.Read(m_fs, m_game);}
2257+ {GamePlayerInfoPacket p; p.read(m_fs, m_game);}
2258 log("Game: Reading Player Info took %ums\n", timer.ms_since_last_query());
2259
2260- log("Game: Calling Read_Complete()\n");
2261- M.Read_Complete(m_game);
2262- log("Game: Read_Complete took: %ums\n", timer.ms_since_last_query());
2263+ log("Game: Calling read_complete()\n");
2264+ M.read_complete(m_game);
2265+ log("Game: read_complete took: %ums\n", timer.ms_since_last_query());
2266
2267 MapObjectLoader * const mol = M.get_map_object_loader();
2268
2269 log("Game: Reading Player Economies Info ... ");
2270- {GamePlayerEconomiesPacket p; p.Read(m_fs, m_game, mol);}
2271+ {GamePlayerEconomiesPacket p; p.read(m_fs, m_game, mol);}
2272 log("took %ums\n", timer.ms_since_last_query());
2273
2274 log("Game: Reading Command Queue Data ... ");
2275- {GameCmdQueuePacket p; p.Read(m_fs, m_game, mol);}
2276+ {GameCmdQueuePacket p; p.read(m_fs, m_game, mol);}
2277 log("took %ums\n", timer.ms_since_last_query());
2278
2279 // This must be after the command queue has been read.
2280@@ -120,7 +120,7 @@
2281 // player.
2282 if (!multiplayer) {
2283 log("Game: Reading Interactive Player Data ... ");
2284- {GameInteractivePlayerPacket p; p.Read(m_fs, m_game, mol);}
2285+ {GameInteractivePlayerPacket p; p.read(m_fs, m_game, mol);}
2286 log("took %ums\n", timer.ms_since_last_query());
2287 }
2288
2289
2290=== modified file 'src/game_io/game_map_packet.cc'
2291--- src/game_io/game_map_packet.cc 2014-09-10 07:57:29 +0000
2292+++ src/game_io/game_map_packet.cc 2014-09-29 14:39:47 +0000
2293@@ -34,16 +34,16 @@
2294 delete m_wml;
2295 }
2296
2297-void GameMapPacket::Read
2298+void GameMapPacket::read
2299 (FileSystem & fs, Game & game, MapObjectLoader * const)
2300 {
2301- if (!fs.FileExists("map") || !fs.IsDirectory("map"))
2302+ if (!fs.file_exists("map") || !fs.is_directory("map"))
2303 throw GameDataError("no map");
2304
2305 // Now Load the map as it would be a normal map saving.
2306 delete m_wml;
2307
2308- m_wml = new WidelandsMapLoader(fs.MakeSubFileSystem("map"), &game.map());
2309+ m_wml = new WidelandsMapLoader(fs.make_sub_file_system("map"), &game.map());
2310
2311 m_wml->preload_map(true);
2312
2313@@ -53,18 +53,18 @@
2314 }
2315
2316
2317-void GameMapPacket::Read_Complete(Game & game) {
2318+void GameMapPacket::read_complete(Game & game) {
2319 m_wml->load_map_complete(game, true);
2320 m_mol = m_wml->get_map_object_loader();
2321 }
2322
2323
2324-void GameMapPacket::Write
2325+void GameMapPacket::write
2326 (FileSystem & fs, Game & game, MapObjectSaver * const)
2327 {
2328
2329 std::unique_ptr<FileSystem> mapfs
2330- (fs.CreateSubFileSystem("map", FileSystem::DIR));
2331+ (fs.create_sub_file_system("map", FileSystem::DIR));
2332
2333 // Now Write the map as it would be a normal map saving.
2334 delete m_wms;
2335
2336=== modified file 'src/game_io/game_map_packet.h'
2337--- src/game_io/game_map_packet.h 2014-09-10 16:57:31 +0000
2338+++ src/game_io/game_map_packet.h 2014-09-29 14:39:47 +0000
2339@@ -36,11 +36,11 @@
2340
2341
2342 /// Ensures that the world gets loaded but does not much more.
2343- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2344-
2345- void Read_Complete(Game &); /// Loads the rest of the map.
2346-
2347- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2348+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2349+
2350+ void read_complete(Game &); /// Loads the rest of the map.
2351+
2352+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2353
2354 MapObjectSaver * get_map_object_saver () {return m_mos;}
2355 MapObjectLoader * get_map_object_loader() {return m_mol;}
2356
2357=== modified file 'src/game_io/game_player_economies_packet.cc'
2358--- src/game_io/game_player_economies_packet.cc 2014-09-10 08:55:04 +0000
2359+++ src/game_io/game_player_economies_packet.cc 2014-09-29 14:39:47 +0000
2360@@ -35,7 +35,7 @@
2361 #define CURRENT_PACKET_VERSION 3
2362
2363
2364-void GamePlayerEconomiesPacket::Read
2365+void GamePlayerEconomiesPacket::read
2366 (FileSystem & fs, Game & game, MapObjectLoader *)
2367 {
2368 try {
2369@@ -44,30 +44,30 @@
2370 PlayerNumber const nr_players = map.get_nrplayers();
2371
2372 FileRead fr;
2373- fr.Open(fs, "binary/player_economies");
2374- uint16_t const packet_version = fr.Unsigned16();
2375+ fr.open(fs, "binary/player_economies");
2376+ uint16_t const packet_version = fr.unsigned_16();
2377 if (3 <= packet_version && packet_version <= CURRENT_PACKET_VERSION) {
2378 iterate_players_existing(p, nr_players, game, player)
2379 try {
2380 Player::Economies & economies = player->m_economies;
2381 for (uint32_t i = 0; i < economies.size(); ++i) {
2382- uint32_t value = fr.Unsigned32();
2383+ uint32_t value = fr.unsigned_32();
2384 if (value < 0xffffffff) {
2385 if (upcast(Flag const, flag, map[value].get_immovable())) {
2386 EconomyDataPacket d(flag->get_economy());
2387- d.Read(fr);
2388+ d.read(fr);
2389 } else {
2390 throw GameDataError("there is no flag at the specified location");
2391 }
2392 } else {
2393 bool read_this_economy = false;
2394
2395- Bob* bob = map[ReadMap_Index32(&fr, max_index)].get_first_bob();
2396+ Bob* bob = map[read_map_index_32(&fr, max_index)].get_first_bob();
2397 while (bob) {
2398 if (upcast(Ship const, ship, bob)) {
2399 assert(ship->get_economy());
2400 EconomyDataPacket d(ship->get_economy());
2401- d.Read(fr);
2402+ d.read(fr);
2403 read_this_economy = true;
2404 }
2405 bob = bob->get_next_bob();
2406@@ -91,12 +91,12 @@
2407 /*
2408 * Write Function
2409 */
2410-void GamePlayerEconomiesPacket::Write
2411+void GamePlayerEconomiesPacket::write
2412 (FileSystem & fs, Game & game, MapObjectSaver * const)
2413 {
2414 FileWrite fw;
2415
2416- fw.Unsigned16(CURRENT_PACKET_VERSION);
2417+ fw.unsigned_16(CURRENT_PACKET_VERSION);
2418
2419 const Map & map = game.map();
2420 const Field & field_0 = map[0];
2421@@ -110,10 +110,10 @@
2422 for (Field const * field = &field_0; field < &map[map.max_index()]; ++field) {
2423 if (upcast(Flag const, flag, field->get_immovable())) {
2424 if (flag->get_economy() == temp_economy) {
2425- fw.Unsigned32(field - &field_0);
2426+ fw.unsigned_32(field - &field_0);
2427
2428 EconomyDataPacket d(flag->get_economy());
2429- d.Write(fw);
2430+ d.write(fw);
2431 wrote_this_economy = true;
2432 break;
2433 }
2434@@ -131,11 +131,11 @@
2435 if (upcast(Ship const, ship, bob)) {
2436 if (ship->get_economy() == temp_economy) {
2437 // TODO(sirver): the 0xffffffff is ugly and fragile.
2438- fw.Unsigned32(0xffffffff); // Sentinel value.
2439- fw.Unsigned32(field - &field_0);
2440+ fw.unsigned_32(0xffffffff); // Sentinel value.
2441+ fw.unsigned_32(field - &field_0);
2442
2443 EconomyDataPacket d(ship->get_economy());
2444- d.Write(fw);
2445+ d.write(fw);
2446 wrote_this_economy = true;
2447 }
2448 }
2449@@ -149,7 +149,7 @@
2450 }
2451 }
2452
2453- fw.Write(fs, "binary/player_economies");
2454+ fw.write(fs, "binary/player_economies");
2455 }
2456
2457 }
2458
2459=== modified file 'src/game_io/game_player_economies_packet.h'
2460--- src/game_io/game_player_economies_packet.h 2014-09-10 16:57:31 +0000
2461+++ src/game_io/game_player_economies_packet.h 2014-09-29 14:39:47 +0000
2462@@ -28,8 +28,8 @@
2463 * how many and which economies does a player have?
2464 */
2465 struct GamePlayerEconomiesPacket : public GameDataPacket {
2466- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2467- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2468+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2469+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2470 };
2471
2472 }
2473
2474=== modified file 'src/game_io/game_player_info_packet.cc'
2475--- src/game_io/game_player_info_packet.cc 2014-09-10 08:55:04 +0000
2476+++ src/game_io/game_player_info_packet.cc 2014-09-29 14:39:47 +0000
2477@@ -33,61 +33,61 @@
2478 #define CURRENT_PACKET_VERSION 15
2479
2480
2481-void GamePlayerInfoPacket::Read
2482+void GamePlayerInfoPacket::read
2483 (FileSystem & fs, Game & game, MapObjectLoader *)
2484 {
2485 try {
2486 FileRead fr;
2487- fr.Open(fs, "binary/player_info");
2488- uint16_t const packet_version = fr.Unsigned16();
2489+ fr.open(fs, "binary/player_info");
2490+ uint16_t const packet_version = fr.unsigned_16();
2491 if (5 <= packet_version && packet_version <= CURRENT_PACKET_VERSION) {
2492- uint32_t const max_players = fr.Unsigned16();
2493+ uint32_t const max_players = fr.unsigned_16();
2494 for (uint32_t i = 1; i < max_players + 1; ++i) {
2495 game.remove_player(i);
2496- if (fr.Unsigned8()) {
2497- bool const see_all = fr.Unsigned8();
2498+ if (fr.unsigned_8()) {
2499+ bool const see_all = fr.unsigned_8();
2500
2501- int32_t const plnum = fr.Unsigned8();
2502+ int32_t const plnum = fr.unsigned_8();
2503 if (plnum < 1 || MAX_PLAYERS < plnum)
2504 throw GameDataError
2505 ("player number (%i) is out of range (1 .. %u)",
2506 plnum, MAX_PLAYERS);
2507 Widelands::TeamNumber team = 0;
2508 if (packet_version >= 9)
2509- team = fr.Unsigned8();
2510-
2511- char const * const tribe_name = fr.CString();
2512-
2513- std::string const name = fr.CString();
2514+ team = fr.unsigned_8();
2515+
2516+ char const * const tribe_name = fr.c_string();
2517+
2518+ std::string const name = fr.c_string();
2519
2520 game.add_player(plnum, 0, tribe_name, name, team);
2521 Player & player = game.player(plnum);
2522 player.set_see_all(see_all);
2523
2524- player.setAI(fr.CString());
2525+ player.set_ai(fr.c_string());
2526
2527 if (packet_version >= 15)
2528- player.ReadStatistics(fr, 3);
2529+ player.read_statistics(fr, 3);
2530 else if (packet_version >= 14)
2531- player.ReadStatistics(fr, 2);
2532+ player.read_statistics(fr, 2);
2533 else if (packet_version >= 12)
2534- player.ReadStatistics(fr, 1);
2535+ player.read_statistics(fr, 1);
2536 else
2537- player.ReadStatistics(fr, 0);
2538+ player.read_statistics(fr, 0);
2539
2540- player.m_casualties = fr.Unsigned32();
2541- player.m_kills = fr.Unsigned32();
2542- player.m_msites_lost = fr.Unsigned32();
2543- player.m_msites_defeated = fr.Unsigned32();
2544- player.m_civil_blds_lost = fr.Unsigned32();
2545- player.m_civil_blds_defeated = fr.Unsigned32();
2546+ player.m_casualties = fr.unsigned_32();
2547+ player.m_kills = fr.unsigned_32();
2548+ player.m_msites_lost = fr.unsigned_32();
2549+ player.m_msites_defeated = fr.unsigned_32();
2550+ player.m_civil_blds_lost = fr.unsigned_32();
2551+ player.m_civil_blds_defeated = fr.unsigned_32();
2552 }
2553 }
2554
2555 if (packet_version <= 10)
2556- game.ReadStatistics(fr, 3);
2557+ game.read_statistics(fr, 3);
2558 else
2559- game.ReadStatistics(fr, 4);
2560+ game.read_statistics(fr, 4);
2561 } else
2562 throw GameDataError
2563 ("unknown/unhandled version %u", packet_version);
2564@@ -97,48 +97,48 @@
2565 }
2566
2567
2568-void GamePlayerInfoPacket::Write
2569+void GamePlayerInfoPacket::write
2570 (FileSystem & fs, Game & game, MapObjectSaver *)
2571 {
2572 FileWrite fw;
2573
2574 // Now packet version
2575- fw.Unsigned16(CURRENT_PACKET_VERSION);
2576+ fw.unsigned_16(CURRENT_PACKET_VERSION);
2577
2578 // Number of (potential) players
2579 PlayerNumber const nr_players = game.map().get_nrplayers();
2580- fw.Unsigned16(nr_players);
2581+ fw.unsigned_16(nr_players);
2582 iterate_players_existing_const(p, nr_players, game, plr) {
2583- fw.Unsigned8(1); // Player is in game.
2584-
2585- fw.Unsigned8(plr->m_see_all);
2586-
2587- fw.Unsigned8(plr->m_plnum);
2588- fw.Unsigned8(plr->team_number());
2589-
2590- fw.CString(plr->tribe().name().c_str());
2591+ fw.unsigned_8(1); // Player is in game.
2592+
2593+ fw.unsigned_8(plr->m_see_all);
2594+
2595+ fw.unsigned_8(plr->m_plnum);
2596+ fw.unsigned_8(plr->team_number());
2597+
2598+ fw.c_string(plr->tribe().name().c_str());
2599
2600 // Seen fields is in a map packet
2601 // Allowed buildings is in a map packet
2602
2603 // Economies are in a packet after map loading
2604
2605- fw.CString(plr->m_name.c_str());
2606- fw.CString(plr->m_ai.c_str());
2607+ fw.c_string(plr->m_name.c_str());
2608+ fw.c_string(plr->m_ai.c_str());
2609
2610- plr->WriteStatistics(fw);
2611- fw.Unsigned32(plr->casualties());
2612- fw.Unsigned32(plr->kills ());
2613- fw.Unsigned32(plr->msites_lost ());
2614- fw.Unsigned32(plr->msites_defeated ());
2615- fw.Unsigned32(plr->civil_blds_lost ());
2616- fw.Unsigned32(plr->civil_blds_defeated());
2617+ plr->write_statistics(fw);
2618+ fw.unsigned_32(plr->casualties());
2619+ fw.unsigned_32(plr->kills ());
2620+ fw.unsigned_32(plr->msites_lost ());
2621+ fw.unsigned_32(plr->msites_defeated ());
2622+ fw.unsigned_32(plr->civil_blds_lost ());
2623+ fw.unsigned_32(plr->civil_blds_defeated());
2624 } else
2625- fw.Unsigned8(0); // Player is NOT in game.
2626-
2627- game.WriteStatistics(fw);
2628-
2629- fw.Write(fs, "binary/player_info");
2630+ fw.unsigned_8(0); // Player is NOT in game.
2631+
2632+ game.write_statistics(fw);
2633+
2634+ fw.write(fs, "binary/player_info");
2635 }
2636
2637 }
2638
2639=== modified file 'src/game_io/game_player_info_packet.h'
2640--- src/game_io/game_player_info_packet.h 2014-09-10 16:57:31 +0000
2641+++ src/game_io/game_player_info_packet.h 2014-09-29 14:39:47 +0000
2642@@ -29,8 +29,8 @@
2643 * a game for a user (for example in a listbox)
2644 */
2645 struct GamePlayerInfoPacket : public GameDataPacket {
2646- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2647- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2648+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2649+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2650 };
2651
2652 }
2653
2654=== modified file 'src/game_io/game_preload_packet.cc'
2655--- src/game_io/game_preload_packet.cc 2014-09-10 13:03:40 +0000
2656+++ src/game_io/game_preload_packet.cc 2014-09-29 14:39:47 +0000
2657@@ -45,7 +45,7 @@
2658 #define MINIMAP_FILENAME "minimap.png"
2659
2660
2661-void GamePreloadPacket::Read
2662+void GamePreloadPacket::read
2663 (FileSystem & fs, Game &, MapObjectLoader * const)
2664 {
2665 try {
2666@@ -62,7 +62,7 @@
2667 m_player_nr = s.get_safe_int("player_nr");
2668 m_win_condition = s.get_safe_string("win_condition");
2669 m_number_of_players = s.get_safe_int(PLAYERS_AMOUNT_KEY_V4);
2670- if (fs.FileExists(MINIMAP_FILENAME)) {
2671+ if (fs.file_exists(MINIMAP_FILENAME)) {
2672 m_minimap_path = MINIMAP_FILENAME;
2673 }
2674 } else {
2675@@ -75,7 +75,7 @@
2676 }
2677
2678
2679-void GamePreloadPacket::Write
2680+void GamePreloadPacket::write
2681 (FileSystem & fs, Game & game, MapObjectSaver * const)
2682 {
2683
2684@@ -116,10 +116,10 @@
2685 if (ipl != nullptr) {
2686 const MiniMapLayer flags = MiniMapLayer::Owner | MiniMapLayer::Building | MiniMapLayer::Terrain;
2687 const Point& vp = ipl->get_viewpoint();
2688- std::unique_ptr< ::StreamWrite> sw(fs.OpenStreamWrite(MINIMAP_FILENAME));
2689+ std::unique_ptr< ::StreamWrite> sw(fs.open_stream_write(MINIMAP_FILENAME));
2690 if (sw.get() != nullptr) {
2691 write_minimap_image(game, &ipl->player(), vp, flags, sw.get());
2692- sw->Flush();
2693+ sw->flush();
2694 }
2695 }
2696 }
2697
2698=== modified file 'src/game_io/game_preload_packet.h'
2699--- src/game_io/game_preload_packet.h 2014-09-10 16:57:31 +0000
2700+++ src/game_io/game_preload_packet.h 2014-09-29 14:39:47 +0000
2701@@ -32,8 +32,8 @@
2702 * a game for a user (for example in a listbox)
2703 */
2704 struct GamePreloadPacket : public GameDataPacket {
2705- void Read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2706- void Write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2707+ void read (FileSystem &, Game &, MapObjectLoader * = nullptr) override;
2708+ void write(FileSystem &, Game &, MapObjectSaver * = nullptr) override;
2709
2710 char const * get_mapname() {return m_mapname.c_str();}
2711 std::string get_background() {return m_background;}
2712
2713=== modified file 'src/game_io/game_saver.cc'
2714--- src/game_io/game_saver.cc 2014-09-10 16:57:31 +0000
2715+++ src/game_io/game_saver.cc 2014-09-29 14:39:47 +0000
2716@@ -43,36 +43,36 @@
2717 void GameSaver::save() {
2718 ScopedTimer timer("GameSaver::save() took %ums");
2719
2720- m_fs.EnsureDirectoryExists("binary");
2721+ m_fs.ensure_directory_exists("binary");
2722
2723 log("Game: Writing Preload Data ... ");
2724- {GamePreloadPacket p; p.Write(m_fs, m_game, nullptr);}
2725+ {GamePreloadPacket p; p.write(m_fs, m_game, nullptr);}
2726 log("took %ums\n", timer.ms_since_last_query());
2727
2728 log("Game: Writing Game Class Data ... ");
2729- {GameClassPacket p; p.Write(m_fs, m_game, nullptr);}
2730+ {GameClassPacket p; p.write(m_fs, m_game, nullptr);}
2731 log("took %ums\n", timer.ms_since_last_query());
2732
2733 log("Game: Writing Player Info ... ");
2734- {GamePlayerInfoPacket p; p.Write(m_fs, m_game, nullptr);}
2735+ {GamePlayerInfoPacket p; p.write(m_fs, m_game, nullptr);}
2736 log("took %ums\n", timer.ms_since_last_query());
2737
2738 log("Game: Writing Map Data!\n");
2739- GameMapPacket M; M.Write(m_fs, m_game, nullptr);
2740+ GameMapPacket M; M.write(m_fs, m_game, nullptr);
2741 log("Game: Writing Map Data took %ums\n", timer.ms_since_last_query());
2742
2743 MapObjectSaver * const mos = M.get_map_object_saver();
2744
2745 log("Game: Writing Player Economies Info ... ");
2746- {GamePlayerEconomiesPacket p; p.Write(m_fs, m_game, mos);}
2747+ {GamePlayerEconomiesPacket p; p.write(m_fs, m_game, mos);}
2748 log("took %ums\n", timer.ms_since_last_query());
2749
2750 log("Game: Writing Command Queue Data ... ");
2751- {GameCmdQueuePacket p; p.Write(m_fs, m_game, mos);}
2752+ {GameCmdQueuePacket p; p.write(m_fs, m_game, mos);}
2753 log("took %ums\n", timer.ms_since_last_query());
2754
2755 log("Game: Writing Interactive Player Data ... ");
2756- {GameInteractivePlayerPacket p; p.Write(m_fs, m_game, mos);}
2757+ {GameInteractivePlayerPacket p; p.write(m_fs, m_game, mos);}
2758 log("took %ums\n", timer.ms_since_last_query());
2759 }
2760
2761
2762=== modified file 'src/graphic/animation.cc'
2763--- src/graphic/animation.cc 2014-09-14 11:31:58 +0000
2764+++ src/graphic/animation.cc 2014-09-29 14:39:47 +0000
2765@@ -173,7 +173,7 @@
2766 if (fps > 0)
2767 frametime_ = 1000 / fps;
2768
2769- hotspot_ = section.get_Point("hotspot");
2770+ hotspot_ = section.get_point("hotspot");
2771
2772 // In the filename template, the last sequence of '?' characters (if any)
2773 // is replaced with a number, for example the template "idle_??" is
2774@@ -193,12 +193,12 @@
2775 string filename_wo_ext;
2776 while (glob.next(&filename_wo_ext)) {
2777 const string filename = filename_wo_ext + ".png";
2778- if (!g_fs->FileExists(filename))
2779+ if (!g_fs->file_exists(filename))
2780 break;
2781 image_files_.push_back(filename);
2782
2783 const string pc_filename = filename_wo_ext + "_pc.png";
2784- if (g_fs->FileExists(pc_filename)) {
2785+ if (g_fs->file_exists(pc_filename)) {
2786 hasplrclrs_ = true;
2787 pc_mask_image_files_.push_back(pc_filename);
2788 }
2789
2790=== modified file 'src/graphic/diranimations.h'
2791--- src/graphic/diranimations.h 2014-07-28 14:08:41 +0000
2792+++ src/graphic/diranimations.h 2014-09-29 14:39:47 +0000
2793@@ -52,7 +52,7 @@
2794 m_animations[dir - 1] = anim;
2795 }
2796
2797- static DirAnimations Null() {
2798+ static DirAnimations null() {
2799 return DirAnimations(0); // Since real animation IDs are positive, this is safe
2800 }
2801
2802
2803=== modified file 'src/graphic/font.cc'
2804--- src/graphic/font.cc 2014-09-14 11:31:58 +0000
2805+++ src/graphic/font.cc 2014-09-29 14:39:47 +0000
2806@@ -58,9 +58,9 @@
2807
2808 // We must keep this File Read open, otherwise the following calls are
2809 // crashing. do not know why...
2810- m_fontfile.Open(*g_fs, filename);
2811+ m_fontfile.open(*g_fs, filename);
2812
2813- SDL_RWops * const ops = SDL_RWFromMem(m_fontfile.Data(0), m_fontfile.GetSize());
2814+ SDL_RWops * const ops = SDL_RWFromMem(m_fontfile.data(0), m_fontfile.get_size());
2815 if (!ops)
2816 throw wexception("could not load font!: RWops Pointer invalid");
2817
2818
2819=== modified file 'src/graphic/graphic.cc'
2820--- src/graphic/graphic.cc 2014-07-25 13:45:18 +0000
2821+++ src/graphic/graphic.cc 2014-09-29 14:39:47 +0000
2822@@ -309,7 +309,7 @@
2823 SDL_GL_SwapBuffers();
2824 glEnable(GL_TEXTURE_2D);
2825
2826- GLSurfaceTexture::Initialize(use_arb);
2827+ GLSurfaceTexture::initialize(use_arb);
2828 }
2829
2830 if (g_opengl)
2831@@ -341,7 +341,7 @@
2832 UI::g_fh->flush();
2833
2834 if (g_opengl)
2835- GLSurfaceTexture::Cleanup();
2836+ GLSurfaceTexture::cleanup();
2837 }
2838
2839 Graphic::~Graphic()
2840@@ -487,7 +487,7 @@
2841 void Graphic::screenshot(const string& fname) const
2842 {
2843 log("Save screenshot to %s\n", fname.c_str());
2844- StreamWrite * sw = g_fs->OpenStreamWrite(fname);
2845+ StreamWrite * sw = g_fs->open_stream_write(fname);
2846 save_surface_to_png(screen_.get(), sw);
2847 delete sw;
2848 }
2849
2850=== modified file 'src/graphic/image_io.cc'
2851--- src/graphic/image_io.cc 2014-07-14 10:45:44 +0000
2852+++ src/graphic/image_io.cc 2014-09-29 14:39:47 +0000
2853@@ -35,14 +35,14 @@
2854
2855 // A helper function for save_surface_to_png. Writes the compressed data to
2856 // the StreamWrite.
2857-void png_write_function(png_structp png_ptr, png_bytep data, png_size_t length) {
2858- static_cast<StreamWrite*>(png_get_io_ptr(png_ptr))->Data(data, length);
2859+void png_write_function(png_structp png_ptr, png_bytep png_data, png_size_t length) {
2860+ static_cast<StreamWrite*>(png_get_io_ptr(png_ptr))->data(png_data, length);
2861 }
2862
2863 // A helper function for save_surface_to_png.
2864 // Flush function to avoid crashes with default libpng flush function
2865 void png_flush_function(png_structp png_ptr) {
2866- static_cast<StreamWrite*>(png_get_io_ptr(png_ptr))->Flush();
2867+ static_cast<StreamWrite*>(png_get_io_ptr(png_ptr))->flush();
2868 }
2869
2870 } // namespace
2871@@ -55,16 +55,16 @@
2872 FileRead fr;
2873 bool found;
2874 if (fs) {
2875- found = fr.TryOpen(*fs, fname);
2876+ found = fr.try_open(*fs, fname);
2877 } else {
2878- found = fr.TryOpen(*g_fs, fname);
2879+ found = fr.try_open(*g_fs, fname);
2880 }
2881
2882 if (!found) {
2883 throw ImageNotFound(fname);
2884 }
2885
2886- SDL_Surface* sdlsurf = IMG_Load_RW(SDL_RWFromMem(fr.Data(0), fr.GetSize()), 1);
2887+ SDL_Surface* sdlsurf = IMG_Load_RW(SDL_RWFromMem(fr.data(0), fr.get_size()), 1);
2888 if (!sdlsurf) {
2889 throw ImageLoadingError(fname.c_str(), IMG_GetError());
2890 }
2891
2892=== modified file 'src/graphic/render/gamerenderer_gl.cc'
2893--- src/graphic/render/gamerenderer_gl.cc 2014-09-14 16:08:13 +0000
2894+++ src/graphic/render/gamerenderer_gl.cc 2014-09-29 14:39:47 +0000
2895@@ -295,7 +295,7 @@
2896 const Texture & texture =
2897 *g_gr->get_maptexture_data
2898 (world.terrain_descr(ter).get_texture());
2899- glBindTexture(GL_TEXTURE_2D, texture.getTexture());
2900+ glBindTexture(GL_TEXTURE_2D, texture.get_texture());
2901 glDrawRangeElements
2902 (GL_TRIANGLES,
2903 0, m_patch_size.w * m_patch_size.h - 1,
2904@@ -472,7 +472,7 @@
2905 const Texture & texture =
2906 *g_gr->get_maptexture_data
2907 (m_egbase->world().terrain_descr(ter).get_texture());
2908- glBindTexture(GL_TEXTURE_2D, texture.getTexture());
2909+ glBindTexture(GL_TEXTURE_2D, texture.get_texture());
2910 glDrawArrays
2911 (GL_TRIANGLES,
2912 3 * m_terrain_edge_freq_cum[ter], 3 * m_terrain_edge_freq[ter]);
2913
2914=== modified file 'src/graphic/render/gl_surface_texture.cc'
2915--- src/graphic/render/gl_surface_texture.cc 2014-07-20 07:44:53 +0000
2916+++ src/graphic/render/gl_surface_texture.cc 2014-09-29 14:39:47 +0000
2917@@ -32,7 +32,7 @@
2918 /**
2919 * Initial global resources needed for fast offscreen rendering.
2920 */
2921-void GLSurfaceTexture::Initialize(bool use_arb) {
2922+void GLSurfaceTexture::initialize(bool use_arb) {
2923 use_arb_ = use_arb;
2924
2925 // Generate the framebuffer for Offscreen rendering.
2926@@ -48,7 +48,7 @@
2927 /**
2928 * Free global resources.
2929 */
2930-void GLSurfaceTexture::Cleanup() {
2931+void GLSurfaceTexture::cleanup() {
2932 if (use_arb_)
2933 glDeleteFramebuffers(1, &gl_framebuffer_id_);
2934 else
2935
2936=== modified file 'src/graphic/render/gl_surface_texture.h'
2937--- src/graphic/render/gl_surface_texture.h 2014-07-26 10:43:23 +0000
2938+++ src/graphic/render/gl_surface_texture.h 2014-09-29 14:39:47 +0000
2939@@ -25,10 +25,10 @@
2940
2941 class GLSurfaceTexture : public GLSurface {
2942 public:
2943- // Call this once before using any instance of this class and Cleanup once
2944+ // Call this once before using any instance of this class and cleanup once
2945 // before the program exits.
2946- static void Initialize(bool use_arb);
2947- static void Cleanup();
2948+ static void initialize(bool use_arb);
2949+ static void cleanup();
2950
2951 GLSurfaceTexture(SDL_Surface * surface, bool intensity = false);
2952 GLSurfaceTexture(int w, int h);
2953
2954=== modified file 'src/graphic/text/font_io.cc'
2955--- src/graphic/text/font_io.cc 2014-09-10 16:57:31 +0000
2956+++ src/graphic/text/font_io.cc 2014-09-29 14:39:47 +0000
2957@@ -41,8 +41,8 @@
2958 std::unique_ptr<std::string> memory;
2959 {
2960 FileRead* fr = new FileRead();
2961- fr->Open(*g_fs, filename);
2962- memory.reset(new std::string(fr->Data(0), fr->GetSize()));
2963+ fr->open(*g_fs, filename);
2964+ memory.reset(new std::string(fr->data(0), fr->get_size()));
2965 }
2966
2967 SDL_RWops* ops = SDL_RWFromConstMem(memory->data(), memory->size());
2968
2969=== modified file 'src/graphic/text/test/render.cc'
2970--- src/graphic/text/test/render.cc 2014-07-14 10:45:44 +0000
2971+++ src/graphic/text/test/render.cc 2014-09-29 14:39:47 +0000
2972@@ -32,8 +32,8 @@
2973
2974 StandaloneRenderer::StandaloneRenderer() {
2975 g_fs = new LayeredFileSystem();
2976- g_fs->AddFileSystem(&FileSystem::Create(WIDELANDS_DATA_DIR));
2977- g_fs->AddFileSystem(&FileSystem::Create(RICHTEXT_DATA_DIR));
2978+ g_fs->add_file_system(&FileSystem::create(WIDELANDS_DATA_DIR));
2979+ g_fs->add_file_system(&FileSystem::create(RICHTEXT_DATA_DIR));
2980
2981 surface_cache_.reset(create_surface_cache(500 << 20)); // 500 MB
2982 image_cache_.reset(new ImageCache(surface_cache_.get()));
2983
2984=== modified file 'src/graphic/text/test/render_richtext.cc'
2985--- src/graphic/text/test/render_richtext.cc 2014-07-20 07:44:53 +0000
2986+++ src/graphic/text/test/render_richtext.cc 2014-09-29 14:39:47 +0000
2987@@ -123,8 +123,8 @@
2988 std::unique_ptr<SDLSurface> surf(
2989 static_cast<SDLSurface*>(standalone_renderer.renderer()->render(txt, w, allowed_tags)));
2990
2991- std::unique_ptr<FileSystem> fs(&FileSystem::Create("."));
2992- std::unique_ptr<StreamWrite> sw(fs->OpenStreamWrite(outname));
2993+ std::unique_ptr<FileSystem> fs(&FileSystem::create("."));
2994+ std::unique_ptr<StreamWrite> sw(fs->open_stream_write(outname));
2995 if (!save_surface_to_png(surf.get(), sw.get())) {
2996 std::cout << "Could not encode PNG." << std::endl;
2997 }
2998
2999=== modified file 'src/graphic/texture.cc'
3000--- src/graphic/texture.cc 2014-07-17 13:26:23 +0000
3001+++ src/graphic/texture.cc 2014-09-29 14:39:47 +0000
3002@@ -51,7 +51,7 @@
3003 }
3004
3005 for (const std::string& fname : texture_files) {
3006- if (!g_fs->FileExists(fname)) {
3007+ if (!g_fs->file_exists(fname)) {
3008 throw wexception("Could not find %s.", fname.c_str());
3009 }
3010
3011
3012=== modified file 'src/graphic/texture.h'
3013--- src/graphic/texture.h 2014-07-12 12:35:05 +0000
3014+++ src/graphic/texture.h 2014-09-29 14:39:47 +0000
3015@@ -59,7 +59,7 @@
3016 RGBColor get_minimap_color(int8_t shade);
3017
3018 void animate(uint32_t time);
3019- uint32_t getTexture() const
3020+ uint32_t get_texture() const
3021 {return m_glFrames.at(m_frame_num)->get_gl_texture();}
3022
3023 private:
3024
3025=== modified file 'src/io/dedicated_log.cc'
3026--- src/io/dedicated_log.cc 2014-06-08 21:47:45 +0000
3027+++ src/io/dedicated_log.cc 2014-09-29 14:39:47 +0000
3028@@ -97,18 +97,18 @@
3029 temp += c.sender.empty() ? "SYSTEM" : c.sender;
3030 temp += "</td><td class=\"recipient\"> ->" + c.recipient + "</td><td class=\"message\">";
3031 temp += c.msg + "</td></tr>\n";
3032- m_chat.Printf("%s", temp.c_str());
3033- m_chat.WriteAppend(*root, m_chat_file_path.c_str());
3034+ m_chat.print_f("%s", temp.c_str());
3035+ m_chat.write_append(*root, m_chat_file_path.c_str());
3036 }
3037
3038 /// Add's a spacer to the chat log
3039-void DedicatedLog::chatAddSpacer() {
3040+void DedicatedLog::chat_add_spacer() {
3041 if (m_chat_file_path.empty())
3042 return;
3043
3044- m_chat.Printf("<tr><td class=\"space\"></td><td class=\"space\"></td>");
3045- m_chat.Printf("<td class=\"space\"></td><td class=\"space\"></td></tr>\n");
3046- m_chat.WriteAppend(*root, m_chat_file_path.c_str());
3047+ m_chat.print_f("<tr><td class=\"space\"></td><td class=\"space\"></td>");
3048+ m_chat.print_f("<td class=\"space\"></td><td class=\"space\"></td></tr>\n");
3049+ m_chat.write_append(*root, m_chat_file_path.c_str());
3050 }
3051
3052
3053@@ -206,8 +206,8 @@
3054 }
3055 }
3056 temp += "</table>\n";
3057- m_chat.Printf("%s", temp.c_str());
3058- m_chat.Write(*root, m_info_file_path.c_str());
3059+ m_chat.print_f("%s", temp.c_str());
3060+ m_chat.write(*root, m_info_file_path.c_str());
3061 }
3062
3063 /// Appends the String \arg msg to the log file
3064@@ -224,8 +224,8 @@
3065 temp += "</td><td class=\"log\">";
3066 temp += msg;
3067 temp += "</td></tr>\n";
3068- m_chat.Printf("%s", temp.c_str());
3069- m_chat.WriteAppend(*root, m_log_file_path.c_str());
3070+ m_chat.print_f("%s", temp.c_str());
3071+ m_chat.write_append(*root, m_log_file_path.c_str());
3072 }
3073
3074
3075@@ -252,8 +252,8 @@
3076 m_chat_file_path = path;
3077
3078 // Initialize the chat file
3079- m_chat.Printf("<tr><th>Time</th><th>Sender</th><th>Recipient</th><th>Message</th></tr>");
3080- m_chat.Write(*root, m_chat_file_path.c_str()); // Not WriteAppend, to make sure the file is cleared
3081+ m_chat.print_f("<tr><th>Time</th><th>Sender</th><th>Recipient</th><th>Message</th></tr>");
3082+ m_chat.write(*root, m_chat_file_path.c_str()); // Not write_append, to make sure the file is cleared
3083 return true;
3084 }
3085
3086@@ -307,8 +307,8 @@
3087 m_log_file_path = path;
3088
3089 // Initialize the log file
3090- m_chat.Printf("<tr><th></th><th>Widelands dedicated server log:</th></tr>\n");
3091- m_chat.Write(*root, m_log_file_path.c_str()); // Not WriteAppend, to make sure the file is cleared
3092+ m_chat.print_f("<tr><th></th><th>Widelands dedicated server log:</th></tr>\n");
3093+ m_chat.write(*root, m_log_file_path.c_str()); // Not write_append, to make sure the file is cleared
3094 return true;
3095 }
3096
3097@@ -323,14 +323,14 @@
3098 * written to does not exist, in all other cases true.
3099 */
3100 bool DedicatedLog::check_file_writeable(std::string & path) {
3101- bool existing = root->FileExists(path);
3102- if (existing && root->IsDirectory(path))
3103+ bool existing = root->file_exists(path);
3104+ if (existing && root->is_directory(path))
3105 return false;
3106- if (root->FileIsWriteable(path)) {
3107+ if (root->file_is_writeable(path)) {
3108 if (existing) {
3109 std::string rnpath(path + '~');
3110- if (root->FileIsWriteable(rnpath))
3111- root->Rename(path, rnpath);
3112+ if (root->file_is_writeable(rnpath))
3113+ root->fs_rename(path, rnpath);
3114 else
3115 log("Note: original file %s could not be backuped\n", path.c_str());
3116 }
3117
3118=== modified file 'src/io/dedicated_log.h'
3119--- src/io/dedicated_log.h 2014-07-13 18:20:03 +0000
3120+++ src/io/dedicated_log.h 2014-09-29 14:39:47 +0000
3121@@ -33,7 +33,7 @@
3122 static DedicatedLog * get();
3123
3124 // chat logging functions
3125- void chatAddSpacer();
3126+ void chat_add_spacer();
3127 void chat(ChatMessage & c);
3128
3129 // info logging functions
3130
3131=== modified file 'src/io/fileread.cc'
3132--- src/io/fileread.cc 2014-09-09 17:15:20 +0000
3133+++ src/io/fileread.cc 2014-09-29 14:39:47 +0000
3134@@ -23,19 +23,19 @@
3135
3136 FileRead::~FileRead() {
3137 if (data_) {
3138- Close();
3139+ close();
3140 }
3141 }
3142
3143-void FileRead::Open(FileSystem& fs, const std::string& filename) {
3144+void FileRead::open(FileSystem& fs, const std::string& filename) {
3145 assert(!data_);
3146- data_ = static_cast<char*>(fs.Load(filename, length_));
3147+ data_ = static_cast<char*>(fs.load(filename, length_));
3148 filepos_ = 0;
3149 }
3150
3151-bool FileRead::TryOpen(FileSystem& fs, const std::string& filename) {
3152+bool FileRead::try_open(FileSystem& fs, const std::string& filename) {
3153 try {
3154- Open(fs, filename);
3155+ open(fs, filename);
3156 }
3157 catch (const std::exception&) {
3158 return false;
3159@@ -43,32 +43,32 @@
3160 return true;
3161 }
3162
3163-void FileRead::Close() {
3164+void FileRead::close() {
3165 assert(data_);
3166 free(data_);
3167 data_ = nullptr;
3168 }
3169
3170-size_t FileRead::GetSize() const {
3171+size_t FileRead::get_size() const {
3172 return length_;
3173 }
3174
3175-bool FileRead::EndOfFile() const {
3176+bool FileRead::end_of_file() const {
3177 return length_ <= filepos_;
3178 }
3179
3180-void FileRead::SetFilePos(Pos const pos) {
3181+void FileRead::set_file_pos(Pos const pos) {
3182 assert(data_);
3183 if (pos >= length_)
3184 throw FileBoundaryExceeded();
3185 filepos_ = pos;
3186 }
3187
3188-FileRead::Pos FileRead::GetPos() const {
3189+FileRead::Pos FileRead::get_pos() const {
3190 return filepos_;
3191 }
3192
3193-size_t FileRead::Data(void* dst, size_t bufsize) {
3194+size_t FileRead::data(void* dst, size_t bufsize) {
3195 assert(data_);
3196 size_t read = 0;
3197 for (; read < bufsize && filepos_ < length_; ++read, ++filepos_) {
3198@@ -77,10 +77,10 @@
3199 return read;
3200 }
3201
3202-char* FileRead::Data(uint32_t const bytes, const Pos pos) {
3203+char* FileRead::data(uint32_t const bytes, const Pos pos) {
3204 assert(data_);
3205 Pos i = pos;
3206- if (pos.isNull()) {
3207+ if (pos.is_null()) {
3208 i = filepos_;
3209 filepos_ += bytes;
3210 }
3211@@ -89,10 +89,10 @@
3212 return data_ + i;
3213 }
3214
3215-char* FileRead::CString(Pos const pos) {
3216+char* FileRead::c_string(Pos const pos) {
3217 assert(data_);
3218
3219- Pos i = pos.isNull() ? filepos_ : pos;
3220+ Pos i = pos.is_null() ? filepos_ : pos;
3221 if (i >= length_)
3222 throw FileBoundaryExceeded();
3223 char* const result = data_ + i;
3224@@ -101,17 +101,17 @@
3225 ++i; // beyond the null
3226 if (i > (length_ + 1)) // allow EOF as end marker for string
3227 throw FileBoundaryExceeded();
3228- if (pos.isNull())
3229+ if (pos.is_null())
3230 filepos_ = i;
3231 return result;
3232 }
3233
3234-char const* FileRead::CString() {
3235- return CString(Pos::Null());
3236+char const* FileRead::c_string() {
3237+ return c_string(Pos::null());
3238 }
3239
3240-char* FileRead::ReadLine() {
3241- if (EndOfFile())
3242+char* FileRead::read_line() {
3243+ if (end_of_file())
3244 return nullptr;
3245 char* result = data_ + filepos_;
3246 for (; data_[filepos_] && data_[filepos_] != '\n'; ++filepos_)
3247
3248=== modified file 'src/io/fileread.h'
3249--- src/io/fileread.h 2014-09-09 17:15:20 +0000
3250+++ src/io/fileread.h 2014-09-29 14:39:47 +0000
3251@@ -40,12 +40,12 @@
3252 Pos(size_t const p = 0) : pos(p) {
3253 }
3254 /// Returns a special value indicating invalidity.
3255- static Pos Null() {
3256+ static Pos null() {
3257 return std::numeric_limits<size_t>::max();
3258 }
3259
3260- bool isNull() const {
3261- return *this == Null();
3262+ bool is_null() const {
3263+ return *this == null();
3264 }
3265 operator size_t() const {
3266 return pos;
3267@@ -72,45 +72,45 @@
3268 ~FileRead() override;
3269
3270 // See base class.
3271- size_t Data(void* dst, size_t bufsize) override;
3272- bool EndOfFile() const override;
3273- char const* CString() override;
3274+ size_t data(void* dst, size_t bufsize) override;
3275+ bool end_of_file() const override;
3276+ char const* c_string() override;
3277
3278 /// Loads a file into memory. Reserves one additional byte which is zeroed,
3279 /// so that text files can be handled like a null-terminated string.
3280 /// \throws an exception if the file couldn't be loaded for whatever reason.
3281
3282 // TODO(unknown): error handling
3283- void Open(FileSystem& fs, const std::string& filename);
3284+ void open(FileSystem& fs, const std::string& filename);
3285
3286- /// Works just like Open, but returns false when the load fails.
3287- // TODO(sirver): This method can be expressed through Open() and should not
3288+ /// Works just like open, but returns false when the load fails.
3289+ // TODO(sirver): This method can be expressed through open() and should not
3290 // be part of the public API, rather a stand alone function.
3291- bool TryOpen(FileSystem& fs, const std::string& filename);
3292+ bool try_open(FileSystem& fs, const std::string& filename);
3293
3294 /// Frees allocated memory.
3295- void Close();
3296+ void close();
3297
3298 // Returns the size of the file in bytes;
3299- size_t GetSize() const;
3300+ size_t get_size() const;
3301
3302 /// Set the file pointer to the given location.
3303 /// \throws File_Boundary_Exceeded if the pointer is out of bound.
3304- void SetFilePos(Pos pos);
3305+ void set_file_pos(Pos pos);
3306
3307 /// Get the position that will be read from in the next read operation that
3308 /// does not specify a position.
3309- Pos GetPos() const;
3310+ Pos get_pos() const;
3311
3312 // Returns the next 'bytes' starting at 'pos' in the file. Can throw
3313 // File_Boundary_Exceeded.
3314- char* Data(uint32_t bytes, Pos pos = Pos::Null());
3315+ char* data(uint32_t bytes, Pos pos = Pos::null());
3316
3317 // Returns the whole file as a string starting from 'pos'.
3318- char* CString(Pos pos);
3319+ char* c_string(Pos pos);
3320
3321 // Returns the next line.
3322- char* ReadLine();
3323+ char* read_line();
3324
3325 private:
3326 char* data_;
3327
3328=== modified file 'src/io/filesystem/disk_filesystem.cc'
3329--- src/io/filesystem/disk_filesystem.cc 2014-09-14 11:31:58 +0000
3330+++ src/io/filesystem/disk_filesystem.cc 2014-09-29 14:39:47 +0000
3331@@ -71,22 +71,22 @@
3332 : m_directory(Directory)
3333 {
3334 // TODO(unknown): check OS permissions on whether the directory is writable!
3335- m_root = FS_CanonicalizeName(Directory);
3336+ m_root = canonicalize_name(Directory);
3337 }
3338
3339
3340 /**
3341 * SHOULD return true if this directory is writable.
3342 */
3343-bool RealFSImpl::IsWritable() const {
3344+bool RealFSImpl::is_writable() const {
3345 // Should be checked here (ondisk state can change)
3346 return true;
3347 }
3348
3349 /// returns true, if the file is writeable
3350-bool RealFSImpl::FileIsWriteable(const std::string & path) {
3351+bool RealFSImpl::file_is_writeable(const std::string & path) {
3352 std::string fullname;
3353- fullname = FS_CanonicalizeName(path);
3354+ fullname = canonicalize_name(path);
3355
3356 // we call fopen with "a" == append to be sure nothing gets overwritten
3357 FILE * const f = fopen(fullname.c_str(), "a");
3358@@ -97,7 +97,7 @@
3359 }
3360
3361
3362-std::set<std::string> RealFSImpl::ListDirectory(const std::string & path)
3363+std::set<std::string> RealFSImpl::list_directory(const std::string & path)
3364 {
3365 #ifdef _WIN32
3366 std::string buf;
3367@@ -124,7 +124,7 @@
3368 if ((strcmp(c_file.name, ".") == 0) || (strcmp(c_file.name, "..") == 0)) {
3369 continue;
3370 }
3371- const std::string filename = FS_CanonicalizeName(realpath + c_file.name);
3372+ const std::string filename = canonicalize_name(realpath + c_file.name);
3373 const std::string result = filename.substr(m_root.size() + 1);
3374 results.insert(result);
3375 } while (_findnext(hFile, &c_file) == 0);
3376@@ -138,7 +138,7 @@
3377 int32_t ofs;
3378
3379 if (path.size()) {
3380- if (pathIsAbsolute(path)) {
3381+ if (is_path_absolute(path)) {
3382 buf = path + "/*";
3383 ofs = 0;
3384 } else {
3385@@ -155,7 +155,7 @@
3386 return results;
3387
3388 for (size_t i = 0; i < gl.gl_pathc; ++i) {
3389- const std::string filename(FS_CanonicalizeName(&gl.gl_pathv[i][ofs]));
3390+ const std::string filename(canonicalize_name(&gl.gl_pathv[i][ofs]));
3391 results.insert(filename.substr(m_root.size() + 1));
3392 }
3393
3394@@ -171,8 +171,8 @@
3395 * \e can't exist then)
3396 */
3397 // TODO(unknown): Can this be rewritten to just using exceptions? Should it?
3398-bool RealFSImpl::FileExists(const std::string & path) {
3399- return FileSystemPath(FS_CanonicalizeName(path)).m_exists;
3400+bool RealFSImpl::file_exists(const std::string & path) {
3401+ return FileSystemPath(canonicalize_name(path)).m_exists;
3402 }
3403
3404 /**
3405@@ -180,15 +180,15 @@
3406 * Also returns false if the pathname is invalid (obviously, because the file
3407 * \e can't exist then)
3408 */
3409-bool RealFSImpl::IsDirectory(const std::string & path) {
3410- return FileSystemPath(FS_CanonicalizeName(path)).m_isDirectory;
3411+bool RealFSImpl::is_directory(const std::string & path) {
3412+ return FileSystemPath(canonicalize_name(path)).m_isDirectory;
3413 }
3414
3415 /**
3416 * Create a sub filesystem out of this filesystem
3417 */
3418-FileSystem * RealFSImpl::MakeSubFileSystem(const std::string & path) {
3419- FileSystemPath fspath(FS_CanonicalizeName(path));
3420+FileSystem * RealFSImpl::make_sub_file_system(const std::string & path) {
3421+ FileSystemPath fspath(canonicalize_name(path));
3422 assert(fspath.m_exists); //TODO(unknown): throw an exception instead
3423
3424 if (fspath.m_isDirectory)
3425@@ -200,16 +200,16 @@
3426 /**
3427 * Create a sub filesystem out of this filesystem
3428 */
3429-FileSystem * RealFSImpl::CreateSubFileSystem(const std::string & path, Type const fs)
3430+FileSystem * RealFSImpl::create_sub_file_system(const std::string & path, Type const fs)
3431 {
3432- FileSystemPath fspath(FS_CanonicalizeName(path));
3433+ FileSystemPath fspath(canonicalize_name(path));
3434 if (fspath.m_exists)
3435 throw wexception
3436 ("path %s already exists, can not create a filesystem from it",
3437 path.c_str());
3438
3439 if (fs == FileSystem::DIR) {
3440- EnsureDirectoryExists(path);
3441+ ensure_directory_exists(path);
3442 return new RealFSImpl(fspath);
3443 } else
3444 return new ZipFilesystem(fspath);
3445@@ -218,8 +218,8 @@
3446 /**
3447 * Remove a number of files
3448 */
3449-void RealFSImpl::Unlink(const std::string & file) {
3450- FileSystemPath fspath(FS_CanonicalizeName(file));
3451+void RealFSImpl::fs_unlink(const std::string & file) {
3452+ FileSystemPath fspath(canonicalize_name(file));
3453 if (!fspath.m_exists)
3454 return;
3455
3456@@ -233,14 +233,14 @@
3457 * Remove a single directory or file
3458 */
3459 void RealFSImpl::m_unlink_file(const std::string & file) {
3460- FileSystemPath fspath(FS_CanonicalizeName(file));
3461+ FileSystemPath fspath(canonicalize_name(file));
3462 assert(fspath.m_exists); //TODO(unknown): throw an exception instead
3463 assert(!fspath.m_isDirectory); //TODO(unknown): throw an exception instead
3464
3465 #ifndef _WIN32
3466 unlink(fspath.c_str());
3467 #else
3468- DeleteFile(fspath.c_str());
3469+ delete_file(fspath.c_str());
3470 #endif
3471 }
3472
3473@@ -248,23 +248,23 @@
3474 * Recursively remove a directory
3475 */
3476 void RealFSImpl::m_unlink_directory(const std::string & file) {
3477- FileSystemPath fspath(FS_CanonicalizeName(file));
3478+ FileSystemPath fspath(canonicalize_name(file));
3479 assert(fspath.m_exists); //TODO(unknown): throw an exception instead
3480 assert(fspath.m_isDirectory); //TODO(unknown): throw an exception instead
3481
3482- FilenameSet files = ListDirectory(file);
3483+ FilenameSet files = list_directory(file);
3484 for
3485 (FilenameSet::iterator pname = files.begin();
3486 pname != files.end();
3487 ++pname)
3488 {
3489- std::string filename = FS_Filename(pname->c_str());
3490+ std::string filename = fs_filename(pname->c_str());
3491 if (filename == "..")
3492 continue;
3493 if (filename == ".")
3494 continue;
3495
3496- if (IsDirectory(*pname))
3497+ if (is_directory(*pname))
3498 m_unlink_directory(*pname);
3499 else
3500 m_unlink_file(*pname);
3501@@ -275,7 +275,7 @@
3502 #ifndef _WIN32
3503 rmdir(fspath.c_str());
3504 #else
3505- RemoveDirectory(fspath.c_str());
3506+ remove_directory(fspath.c_str());
3507 #endif
3508 }
3509
3510@@ -283,20 +283,20 @@
3511 * Create this directory if it doesn't exist, throws an error
3512 * if the dir can't be created or if a file with this name exists
3513 */
3514-void RealFSImpl::EnsureDirectoryExists(const std::string & dirname)
3515+void RealFSImpl::ensure_directory_exists(const std::string & dirname)
3516 {
3517 try {
3518 std::string::size_type it = 0;
3519 while (it < dirname.size()) {
3520 it = dirname.find(m_filesep, it);
3521
3522- FileSystemPath fspath(FS_CanonicalizeName(dirname.substr(0, it)));
3523+ FileSystemPath fspath(canonicalize_name(dirname.substr(0, it)));
3524 if (fspath.m_exists && !fspath.m_isDirectory)
3525 throw wexception
3526 ("%s exists and is not a directory",
3527 dirname.substr(0, it).c_str());
3528 if (!fspath.m_exists)
3529- MakeDirectory(dirname.substr(0, it));
3530+ make_directory(dirname.substr(0, it));
3531
3532 if (it == std::string::npos)
3533 break;
3534@@ -304,7 +304,7 @@
3535 }
3536 } catch (const std::exception & e) {
3537 throw wexception
3538- ("RealFSImpl::EnsureDirectoryExists(%s): %s",
3539+ ("RealFSImpl::ensure_directory_exists(%s): %s",
3540 dirname.c_str(), e.what());
3541 }
3542 }
3543@@ -314,11 +314,11 @@
3544 * if a file is in the way or if the creation fails.
3545 *
3546 * Pleas note, this function does not honor parents,
3547- * MakeDirectory("onedir/otherdir/onemoredir") will fail
3548+ * make_directory("onedir/otherdir/onemoredir") will fail
3549 * if either onedir or otherdir is missing
3550 */
3551-void RealFSImpl::MakeDirectory(const std::string & dirname) {
3552- FileSystemPath fspath(FS_CanonicalizeName(dirname));
3553+void RealFSImpl::make_directory(const std::string & dirname) {
3554+ FileSystemPath fspath(canonicalize_name(dirname));
3555 if (fspath.m_exists)
3556 throw wexception
3557 ("a file with the name \"%s\" already exists", dirname.c_str());
3558@@ -333,19 +333,19 @@
3559 ==
3560 -1)
3561 throw DirectoryCannotCreateError
3562- ("RealFSImpl::MakeDirectory",
3563+ ("RealFSImpl::make_directory",
3564 dirname,
3565 strerror(errno));
3566 }
3567
3568 /**
3569- * Read the given file into alloced memory; called by FileRead::Open.
3570+ * Read the given file into alloced memory; called by FileRead::open.
3571 * Throws an exception if the file couldn't be opened.
3572 */
3573-void * RealFSImpl::Load(const std::string & fname, size_t & length) {
3574- const std::string fullname = FS_CanonicalizeName(fname);
3575- if (IsDirectory(fullname)) {
3576- throw FileError("RealFSImpl::Load", fullname.c_str());
3577+void * RealFSImpl::load(const std::string & fname, size_t & length) {
3578+ const std::string fullname = canonicalize_name(fname);
3579+ if (is_directory(fullname)) {
3580+ throw FileError("RealFSImpl::load", fullname.c_str());
3581 }
3582
3583 FILE * file = nullptr;
3584@@ -354,7 +354,7 @@
3585 try {
3586 file = fopen(fullname.c_str(), "rb");
3587 if (!file)
3588- throw FileError("RealFSImpl::Load", fullname.c_str());
3589+ throw FileError("RealFSImpl::load", fullname.c_str());
3590
3591 // determine the size of the file (rather quirky, but it doesn't require
3592 // potentially unportable functions)
3593@@ -364,7 +364,7 @@
3594 const int32_t ftell_pos = ftell(file);
3595 if (ftell_pos < 0)
3596 throw wexception
3597- ("RealFSImpl::Load: error when loading \"%s\" (\"%s\"): file "
3598+ ("RealFSImpl::load: error when loading \"%s\" (\"%s\"): file "
3599 "size calculation yielded negative value %i",
3600 fname.c_str(), fullname.c_str(), ftell_pos);
3601 size = ftell_pos;
3602@@ -376,7 +376,7 @@
3603 int result = fread(data, size, 1, file);
3604 if (size && (result != 1)) {
3605 throw wexception
3606- ("RealFSImpl::Load: read failed for %s (%s) with size %" PRIuS "",
3607+ ("RealFSImpl::load: read failed for %s (%s) with size %" PRIuS "",
3608 fname.c_str(), fullname.c_str(), size);
3609 }
3610 static_cast<int8_t *>(data)[size] = 0;
3611@@ -402,11 +402,11 @@
3612 * that file.
3613 * Throws an exception if it fails.
3614 */
3615-void RealFSImpl::Write(const std::string & fname, void const * const data, int32_t const length, bool append)
3616+void RealFSImpl::write(const std::string & fname, void const * const data, int32_t const length, bool append)
3617 {
3618 std::string fullname;
3619
3620- fullname = FS_CanonicalizeName(fname);
3621+ fullname = canonicalize_name(fname);
3622
3623 FILE * const f = fopen(fullname.c_str(), append ? "a" : "wb");
3624 if (!f)
3625@@ -422,11 +422,11 @@
3626 }
3627
3628 // rename a file or directory
3629-void RealFSImpl::Rename
3630+void RealFSImpl::fs_rename
3631 (const std::string & old_name, const std::string & new_name)
3632 {
3633- const std::string fullname1 = FS_CanonicalizeName(old_name);
3634- const std::string fullname2 = FS_CanonicalizeName(new_name);
3635+ const std::string fullname1 = canonicalize_name(old_name);
3636+ const std::string fullname2 = canonicalize_name(new_name);
3637 rename(fullname1.c_str(), fullname2.c_str());
3638 }
3639
3640@@ -452,11 +452,11 @@
3641 fclose(m_file);
3642 }
3643
3644- size_t Data(void * data, size_t const bufsize) override {
3645- return fread(data, 1, bufsize, m_file);
3646+ size_t data(void * read_data, size_t const bufsize) override {
3647+ return fread(read_data, 1, bufsize, m_file);
3648 }
3649
3650- bool EndOfFile() const override
3651+ bool end_of_file() const override
3652 {
3653 return feof(m_file);
3654 }
3655@@ -467,8 +467,8 @@
3656
3657 }
3658
3659-StreamRead * RealFSImpl::OpenStreamRead(const std::string & fname) {
3660- const std::string fullname = FS_CanonicalizeName(fname);
3661+StreamRead * RealFSImpl::open_stream_read(const std::string & fname) {
3662+ const std::string fullname = canonicalize_name(fname);
3663
3664 return new RealFSStreamRead(fullname);
3665 }
3666@@ -493,15 +493,15 @@
3667
3668 ~RealFSStreamWrite() {fclose(m_file);}
3669
3670- void Data(const void * const data, const size_t size) override
3671+ void data(const void * const write_data, const size_t size) override
3672 {
3673- size_t ret = fwrite(data, 1, size, m_file);
3674+ size_t ret = fwrite(write_data, 1, size, m_file);
3675
3676 if (ret != size)
3677 throw wexception("Write to %s failed", m_filename.c_str());
3678 }
3679
3680- void Flush() override
3681+ void flush() override
3682 {
3683 fflush(m_file);
3684 }
3685@@ -513,25 +513,25 @@
3686
3687 }
3688
3689-StreamWrite * RealFSImpl::OpenStreamWrite(const std::string & fname) {
3690- const std::string fullname = FS_CanonicalizeName(fname);
3691+StreamWrite * RealFSImpl::open_stream_write(const std::string & fname) {
3692+ const std::string fullname = canonicalize_name(fname);
3693
3694 return new RealFSStreamWrite(fullname);
3695 }
3696
3697-unsigned long long RealFSImpl::DiskSpace() {
3698+unsigned long long RealFSImpl::disk_space() {
3699 #ifdef _WIN32
3700 ULARGE_INTEGER freeavailable;
3701 return
3702 GetDiskFreeSpaceEx
3703- (FS_CanonicalizeName(m_directory).c_str(), &freeavailable, 0, 0)
3704+ (canonicalize_name(m_directory).c_str(), &freeavailable, 0, 0)
3705 ?
3706 //if more than 2G free space report that much
3707 freeavailable.HighPart ? std::numeric_limits<unsigned long>::max() :
3708 freeavailable.LowPart : 0;
3709 #else
3710 struct statvfs svfs;
3711- if (statvfs(FS_CanonicalizeName(m_directory).c_str(), &svfs) != -1) {
3712+ if (statvfs(canonicalize_name(m_directory).c_str(), &svfs) != -1) {
3713 return static_cast<unsigned long long>(svfs.f_bsize) * svfs.f_bavail;
3714 }
3715 #endif
3716
3717=== modified file 'src/io/filesystem/disk_filesystem.h'
3718--- src/io/filesystem/disk_filesystem.h 2014-07-26 10:43:23 +0000
3719+++ src/io/filesystem/disk_filesystem.h 2014-09-29 14:39:47 +0000
3720@@ -30,32 +30,32 @@
3721 public:
3722 RealFSImpl(const std::string & Directory);
3723
3724- std::set<std::string> ListDirectory(const std::string& path) override;
3725-
3726- bool IsWritable() const override;
3727- bool FileIsWriteable(const std::string & path);
3728- bool FileExists (const std::string & path) override;
3729- bool IsDirectory(const std::string & path) override;
3730- void EnsureDirectoryExists(const std::string & dirname) override;
3731- void MakeDirectory (const std::string & dirname) override;
3732-
3733- void * Load(const std::string & fname, size_t & length) override;
3734-
3735-
3736- void Write(const std::string & fname, void const * data, int32_t length, bool append);
3737- void Write(const std::string & fname, void const * data, int32_t length) override
3738- {Write(fname, data, length, false);}
3739-
3740- StreamRead * OpenStreamRead (const std::string & fname) override;
3741- StreamWrite * OpenStreamWrite(const std::string & fname) override;
3742-
3743- FileSystem * MakeSubFileSystem(const std::string & dirname) override;
3744- FileSystem * CreateSubFileSystem(const std::string & dirname, Type) override;
3745- void Unlink(const std::string & file) override;
3746- void Rename(const std::string & old_name, const std::string & new_name) override;
3747-
3748- std::string getBasename() override {return m_directory;}
3749- unsigned long long DiskSpace() override;
3750+ std::set<std::string> list_directory(const std::string& path) override;
3751+
3752+ bool is_writable() const override;
3753+ bool file_is_writeable(const std::string & path);
3754+ bool file_exists (const std::string & path) override;
3755+ bool is_directory(const std::string & path) override;
3756+ void ensure_directory_exists(const std::string & fs_dirname) override;
3757+ void make_directory (const std::string & fs_dirname) override;
3758+
3759+ void * load(const std::string & fname, size_t & length) override;
3760+
3761+
3762+ void write(const std::string & fname, void const * data, int32_t length, bool append);
3763+ void write(const std::string & fname, void const * data, int32_t length) override
3764+ {write(fname, data, length, false);}
3765+
3766+ StreamRead * open_stream_read (const std::string & fname) override;
3767+ StreamWrite * open_stream_write(const std::string & fname) override;
3768+
3769+ FileSystem * make_sub_file_system(const std::string & fs_dirname) override;
3770+ FileSystem * create_sub_file_system(const std::string & fs_dirname, Type) override;
3771+ void fs_unlink(const std::string & file) override;
3772+ void fs_rename(const std::string & old_name, const std::string & new_name) override;
3773+
3774+ std::string get_basename() override {return m_directory;}
3775+ unsigned long long disk_space() override;
3776
3777 private:
3778 void m_unlink_directory(const std::string & file);
3779
3780=== modified file 'src/io/filesystem/filesystem.cc'
3781--- src/io/filesystem/filesystem.cc 2014-09-10 13:03:40 +0000
3782+++ src/io/filesystem/filesystem.cc 2014-09-29 14:39:47 +0000
3783@@ -75,7 +75,7 @@
3784 * \param path A file or directory name
3785 * \return True if ref path is absolute and within this FileSystem, false otherwise
3786 */
3787-bool FileSystem::pathIsAbsolute(const std::string & path) const {
3788+bool FileSystem::is_path_absolute(const std::string & path) const {
3789 std::string::size_type const path_size = path .size();
3790 std::string::size_type const root_size = m_root.size();
3791
3792@@ -107,7 +107,7 @@
3793 * This function is used to make sure that paths send via network are usable
3794 * on locale OS.
3795 */
3796-std::string FileSystem::fixCrossFile(const std::string & path) const {
3797+std::string FileSystem::fix_cross_file(const std::string & path) const {
3798 uint32_t path_size = path.size();
3799 std::string fixedPath(path);
3800 std::string temp;
3801@@ -141,18 +141,18 @@
3802 /**
3803 * \return The process' current working directory
3804 */
3805-std::string FileSystem::getWorkingDirectory() const {
3806+std::string FileSystem::get_working_directory() const {
3807 char cwd[PATH_MAX + 1];
3808 char * const result = getcwd(cwd, PATH_MAX);
3809 if (! result)
3810- throw FileError("FileSystem::getWorkingDirectory()", "widelands", "can not run getcwd");
3811+ throw FileError("FileSystem::get_working_directory()", "widelands", "can not run getcwd");
3812
3813 return std::string(cwd);
3814 }
3815
3816
3817 // TODO(unknown): Write homedir detection for non-getenv-systems
3818-std::string FileSystem::GetHomedir()
3819+std::string FileSystem::get_homedir()
3820 {
3821 std::string homedir;
3822 #ifdef _WIN32
3823@@ -199,7 +199,7 @@
3824 * \param components The output iterator to place the path nodes into
3825 */
3826 template<typename Inserter>
3827-static void FS_Tokenize
3828+static void fs_tokenize
3829 (const std::string & path, char const filesep, Inserter components)
3830 {
3831 std::string::size_type pos; // start of token
3832@@ -234,7 +234,7 @@
3833 * Transform any valid, unique pathname into a well-formed absolute path
3834 */
3835 // TODO(unknown): Enable non-Unix paths
3836-std::string FileSystem::FS_CanonicalizeName(std::string path) const {
3837+std::string FileSystem::canonicalize_name(std::string path) const {
3838 std::list<std::string> components;
3839 std::list<std::string>::iterator i;
3840
3841@@ -246,19 +246,19 @@
3842 }
3843 #endif
3844
3845- FS_Tokenize(path, m_filesep, std::inserter(components, components.begin()));
3846+ fs_tokenize(path, m_filesep, std::inserter(components, components.begin()));
3847
3848 //tilde expansion
3849 if (!components.empty() && *components.begin() == "~") {
3850 components.erase(components.begin());
3851- FS_Tokenize
3852- (GetHomedir(),
3853+ fs_tokenize
3854+ (get_homedir(),
3855 m_filesep,
3856 std::inserter(components, components.begin()));
3857- } else if (!pathIsAbsolute(path))
3858+ } else if (!is_path_absolute(path))
3859 // make relative paths absolute (so that "../../foo" can work)
3860- FS_Tokenize
3861- (m_root.empty() ? getWorkingDirectory() : m_root, m_filesep,
3862+ fs_tokenize
3863+ (m_root.empty() ? get_working_directory() : m_root, m_filesep,
3864 std::inserter(components, components.begin()));
3865
3866 //clean up the path
3867@@ -316,7 +316,7 @@
3868 * Returns the filename of this path, everything after the last
3869 * / or \ (or the whole string)
3870 */
3871-const char * FileSystem::FS_Filename(const char * p) {
3872+const char * FileSystem::fs_filename(const char * p) {
3873 const char * result = p;
3874
3875 while (*p != '\0') {
3876@@ -328,12 +328,12 @@
3877 return result;
3878 }
3879
3880-std::string FileSystem::FS_Dirname(const std::string& full_path) {
3881- const std::string filename = FS_Filename(full_path.c_str());
3882+std::string FileSystem::fs_dirname(const std::string& full_path) {
3883+ const std::string filename = fs_filename(full_path.c_str());
3884 return full_path.substr(0, full_path.size() - filename.size());
3885 }
3886
3887-std::string FileSystem::FS_FilenameExt(const std::string & f)
3888+std::string FileSystem::filename_ext(const std::string & f)
3889 {
3890 // Find last '.' - denotes start of extension
3891 size_t ext_start = f.rfind('.');
3892@@ -344,10 +344,10 @@
3893 return f.substr(ext_start);
3894 }
3895
3896-std::string FileSystem::FS_FilenameWoExt(const char * const p)
3897+std::string FileSystem::filename_without_ext(const char * const p)
3898 {
3899- std::string fname(p ? FileSystem::FS_Filename(p) : "");
3900- std::string ext(FileSystem::FS_FilenameExt(fname));
3901+ std::string fname(p ? FileSystem::fs_filename(p) : "");
3902+ std::string ext(FileSystem::filename_ext(fname));
3903 return fname.substr(0, fname.length() - ext.length());
3904 }
3905
3906@@ -361,7 +361,7 @@
3907 // TODO(unknown): Catch FileNotFoundError in all users
3908 // TODO(unknown): throw FileTypeError if root is not a zipfile (exception from
3909 // ZipFilesystem)
3910-FileSystem & FileSystem::Create(const std::string & root)
3911+FileSystem & FileSystem::create(const std::string & root)
3912 {
3913 struct stat statinfo;
3914
3915@@ -375,10 +375,10 @@
3916 #endif
3917 errno == ENAMETOOLONG)
3918 {
3919- throw FileNotFoundError("FileSystem::Create", root);
3920+ throw FileNotFoundError("FileSystem::create", root);
3921 }
3922 if (errno == EACCES)
3923- throw FileAccessDeniedError("FileSystem::Create", root);
3924+ throw FileAccessDeniedError("FileSystem::create", root);
3925 }
3926
3927 if (S_ISDIR(statinfo.st_mode)) {
3928@@ -389,7 +389,7 @@
3929 }
3930
3931 throw FileTypeError
3932- ("FileSystem::Create", root,
3933+ ("FileSystem::create", root,
3934 "cannot create virtual filesystem from file or directory");
3935 }
3936
3937@@ -400,12 +400,12 @@
3938 {
3939 RealFSImpl fs(path);
3940
3941- if (fs.IsDirectory(".widelands"))
3942+ if (fs.is_directory(".widelands"))
3943 return true;
3944 try {
3945 // throws an exception if not writable
3946- fs.EnsureDirectoryExists(".widelands");
3947- fs.Unlink(".widelands");
3948+ fs.ensure_directory_exists(".widelands");
3949+ fs.unlink(".widelands");
3950 return true;
3951 } catch (...) {
3952 log("Directory %s is not writeable - next try\n", path);
3953
3954=== modified file 'src/io/filesystem/filesystem.h'
3955--- src/io/filesystem/filesystem.h 2014-09-14 11:31:58 +0000
3956+++ src/io/filesystem/filesystem.h 2014-09-29 14:39:47 +0000
3957@@ -53,20 +53,20 @@
3958 virtual ~FileSystem() {}
3959
3960 // Returns all files and directories (full path) in the given directory 'directory'.
3961- virtual std::set<std::string> ListDirectory(const std::string& directory) = 0;
3962-
3963- virtual bool IsWritable() const = 0;
3964- virtual bool IsDirectory(const std::string & path) = 0;
3965- virtual bool FileExists (const std::string & path) = 0;
3966-
3967- virtual void * Load(const std::string & fname, size_t & length) = 0;
3968-
3969- virtual void Write
3970+ virtual std::set<std::string> list_directory(const std::string& directory) = 0;
3971+
3972+ virtual bool is_writable() const = 0;
3973+ virtual bool is_directory(const std::string & path) = 0;
3974+ virtual bool file_exists (const std::string & path) = 0;
3975+
3976+ virtual void * load(const std::string & fname, size_t & length) = 0;
3977+
3978+ virtual void write
3979 (const std::string & fname, void const * data, int32_t length)
3980 = 0;
3981- virtual void EnsureDirectoryExists(const std::string & dirname) = 0;
3982- //TODO(unknown): use this only from inside EnsureDirectoryExists()
3983- virtual void MakeDirectory(const std::string & dirname) = 0;
3984+ virtual void ensure_directory_exists(const std::string & fs_dirname) = 0;
3985+ //TODO(unknown): use this only from inside ensure_directory_exists()
3986+ virtual void make_directory(const std::string & fs_dirname) = 0;
3987
3988 /**
3989 * Opens the given file for reading as a stream.
3990@@ -75,7 +75,7 @@
3991 * \return a \ref StreamRead object for the file. The caller must delete this
3992 * object when done to close the file.
3993 */
3994- virtual StreamRead * OpenStreamRead(const std::string & fname) = 0;
3995+ virtual StreamRead * open_stream_read(const std::string & fname) = 0;
3996
3997 /**
3998 * Opens the given file for writing as a stream.
3999@@ -87,47 +87,47 @@
4000 * delete this object when done to close the file (which will implicitly
4001 * flush unwritten data).
4002 */
4003- virtual StreamWrite * OpenStreamWrite(const std::string & fname) = 0;
4004+ virtual StreamWrite * open_stream_write(const std::string & fname) = 0;
4005
4006 /**
4007 * Creates a subfilesystem from an existing file/directory.
4008 * Passes ownership to caller.
4009 */
4010- virtual FileSystem * MakeSubFileSystem(const std::string & dirname) = 0;
4011+ virtual FileSystem * make_sub_file_system(const std::string & fs_dirname) = 0;
4012 /**
4013 * Creates a subfilesystem from a new file/directory.
4014 * Passes ownership to caller.
4015 */
4016- virtual FileSystem * CreateSubFileSystem(const std::string & dirname, Type) = 0;
4017- virtual void Unlink(const std::string &) = 0;
4018- virtual void Rename(const std::string &, const std::string &) = 0;
4019+ virtual FileSystem * create_sub_file_system(const std::string & fs_dirname, Type) = 0;
4020+ virtual void fs_unlink(const std::string &) = 0;
4021+ virtual void fs_rename(const std::string &, const std::string &) = 0;
4022
4023- static FileSystem & Create(const std::string & root)
4024+ static FileSystem & create(const std::string & root)
4025 ;
4026
4027 ///Retrieve the filesystem root's name == the mountpoint inside a
4028 ///LayeredFileSystem
4029- virtual std::string getBasename() = 0;
4030+ virtual std::string get_basename() = 0;
4031
4032 // basic path/filename manipulation
4033- std::string fixCrossFile(const std::string &) const;
4034- char fileSeparator() {return m_filesep;}
4035- std::string getWorkingDirectory() const;
4036- std::string FS_CanonicalizeName(std::string path) const;
4037- bool pathIsAbsolute(const std::string & path) const;
4038+ std::string fix_cross_file(const std::string &) const;
4039+ char file_separator() {return m_filesep;}
4040+ std::string get_working_directory() const;
4041+ std::string canonicalize_name(std::string path) const;
4042+ bool is_path_absolute(const std::string & path) const;
4043
4044 ///Given a filename, return the name with any path stripped off.
4045- static const char * FS_Filename(const char * n);
4046- static std::string FS_Dirname(const std::string& full_path);
4047+ static const char * fs_filename(const char * n);
4048+ static std::string fs_dirname(const std::string& full_path);
4049
4050 ///Given a filename (without any path), return the extension, if any.
4051- static std::string FS_FilenameExt(const std::string & f);
4052+ static std::string filename_ext(const std::string & f);
4053
4054 ///Given a filename, return the name with any path or extension stripped off.
4055- static std::string FS_FilenameWoExt(const char * n);
4056- static std::string GetHomedir();
4057+ static std::string filename_without_ext(const char * n);
4058+ static std::string get_homedir();
4059
4060- virtual unsigned long long DiskSpace() = 0;
4061+ virtual unsigned long long disk_space() = 0;
4062
4063 protected:
4064 ///To get a filesystem, use the Create methods
4065
4066=== modified file 'src/io/filesystem/layered_filesystem.cc'
4067--- src/io/filesystem/layered_filesystem.cc 2014-09-14 11:31:58 +0000
4068+++ src/io/filesystem/layered_filesystem.cc 2014-09-29 14:39:47 +0000
4069@@ -43,15 +43,15 @@
4070 * Just assume that at least one of our child FSs is writable
4071 */
4072 // TODO(unknown): Implement me
4073-bool LayeredFileSystem::IsWritable() const {
4074+bool LayeredFileSystem::is_writable() const {
4075 return true;
4076 }
4077
4078-void LayeredFileSystem::AddFileSystem(FileSystem* fs) {
4079+void LayeredFileSystem::add_file_system(FileSystem* fs) {
4080 m_filesystems.emplace_back(fs);
4081 }
4082
4083-void LayeredFileSystem::SetHomeFileSystem(FileSystem * fs)
4084+void LayeredFileSystem::set_home_file_system(FileSystem * fs)
4085 {
4086 m_home.reset(fs);
4087 }
4088@@ -60,11 +60,11 @@
4089 * Remove a filesystem from the stack
4090 * \param fs The filesystem to be removed
4091 */
4092-void LayeredFileSystem::RemoveFileSystem(const FileSystem & fs)
4093+void LayeredFileSystem::remove_file_system(const FileSystem & fs)
4094 {
4095 if (m_filesystems.back().get() != &fs)
4096 throw std::logic_error
4097- ("LayeredFileSystem::RemoveFileSystem: interspersed add/remove "
4098+ ("LayeredFileSystem::remove_file_system: interspersed add/remove "
4099 "detected!");
4100 m_filesystems.pop_back();
4101 }
4102@@ -77,12 +77,12 @@
4103 *
4104 * Returns the number of files found.
4105 */
4106-std::set<std::string> LayeredFileSystem::ListDirectory(const std::string& path) {
4107+std::set<std::string> LayeredFileSystem::list_directory(const std::string& path) {
4108 std::set<std::string> results;
4109 FilenameSet files;
4110 //check home system first
4111 if (m_home) {
4112- files = m_home->ListDirectory(path);
4113+ files = m_home->list_directory(path);
4114 for
4115 (FilenameSet::iterator fnit = files.begin();
4116 fnit != files.end();
4117@@ -91,7 +91,7 @@
4118 }
4119
4120 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it) {
4121- files = (*it)->ListDirectory(path);
4122+ files = (*it)->list_directory(path);
4123
4124 for (FilenameSet::iterator fnit = files.begin(); fnit != files.end(); ++fnit)
4125 results.insert(*fnit);
4126@@ -102,11 +102,11 @@
4127 /**
4128 * Returns true if the file can be found in at least one of the sub-filesystems
4129 */
4130-bool LayeredFileSystem::FileExists(const std::string & path) {
4131- if (m_home && m_home->FileExists(path))
4132+bool LayeredFileSystem::file_exists(const std::string & path) {
4133+ if (m_home && m_home->file_exists(path))
4134 return true;
4135 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4136- if ((*it)->FileExists(path))
4137+ if ((*it)->file_exists(path))
4138 return true;
4139
4140 return false;
4141@@ -116,32 +116,32 @@
4142 * Returns true if path is a directory in at least one of the directories
4143 */
4144 // TODO(unknown): What if it's a file in some and a dir in others?????
4145-bool LayeredFileSystem::IsDirectory(const std::string & path) {
4146- if (m_home && m_home->IsDirectory(path))
4147+bool LayeredFileSystem::is_directory(const std::string & path) {
4148+ if (m_home && m_home->is_directory(path))
4149 return true;
4150
4151 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4152- if ((*it)->IsDirectory(path))
4153+ if ((*it)->is_directory(path))
4154 return true;
4155
4156 return false;
4157 }
4158
4159 /**
4160- * Read the given file into alloced memory; called by FileRead::Open.
4161+ * Read the given file into alloced memory; called by FileRead::open.
4162 * Throws an exception if the file couldn't be opened.
4163 *
4164 * Note: We first query the sub-filesystem whether the file exists. Otherwise,
4165 * we'd have problems differentiating the errors returned by the sub-FS.
4166 * Let's just avoid any possible hassles with that.
4167 */
4168-void * LayeredFileSystem::Load(const std::string & fname, size_t & length) {
4169- if (m_home && m_home->FileExists(fname))
4170- return m_home->Load(fname, length);
4171+void * LayeredFileSystem::load(const std::string & fname, size_t & length) {
4172+ if (m_home && m_home->file_exists(fname))
4173+ return m_home->load(fname, length);
4174
4175 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4176- if ((*it)->FileExists(fname))
4177- return (*it)->Load(fname, length);
4178+ if ((*it)->file_exists(fname))
4179+ return (*it)->load(fname, length);
4180
4181 throw FileNotFoundError("Could not find file", fname);
4182 }
4183@@ -150,15 +150,15 @@
4184 * Write the given block of memory out as a file to the first writable sub-FS.
4185 * Throws an exception if it fails.
4186 */
4187-void LayeredFileSystem::Write
4188+void LayeredFileSystem::write
4189 (const std::string & fname, void const * const data, int32_t const length)
4190 {
4191- if (m_home && m_home->IsWritable())
4192- return m_home->Write(fname, data, length);
4193+ if (m_home && m_home->is_writable())
4194+ return m_home->write(fname, data, length);
4195
4196 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4197- if ((*it)->IsWritable())
4198- return (*it)->Write(fname, data, length);
4199+ if ((*it)->is_writable())
4200+ return (*it)->write(fname, data, length);
4201
4202 throw wexception("LayeredFileSystem: No writable filesystem!");
4203 }
4204@@ -167,13 +167,13 @@
4205 * Analogously to Read, open the file from the first sub-filesystem where
4206 * it exists.
4207 */
4208-StreamRead * LayeredFileSystem::OpenStreamRead (const std::string & fname) {
4209- if (m_home && m_home->FileExists(fname))
4210- return m_home->OpenStreamRead(fname);
4211+StreamRead * LayeredFileSystem::open_stream_read (const std::string & fname) {
4212+ if (m_home && m_home->file_exists(fname))
4213+ return m_home->open_stream_read(fname);
4214
4215 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4216- if ((*it)->FileExists(fname))
4217- return (*it)->OpenStreamRead(fname);
4218+ if ((*it)->file_exists(fname))
4219+ return (*it)->open_stream_read(fname);
4220
4221 throw FileNotFoundError("Could not find file", fname);
4222 }
4223@@ -181,13 +181,13 @@
4224 /**
4225 * Analogously to Write, create the file in the first writable sub-FS.
4226 */
4227-StreamWrite * LayeredFileSystem::OpenStreamWrite(const std::string & fname) {
4228- if (m_home && m_home->IsWritable())
4229- return m_home->OpenStreamWrite(fname);
4230+StreamWrite * LayeredFileSystem::open_stream_write(const std::string & fname) {
4231+ if (m_home && m_home->is_writable())
4232+ return m_home->open_stream_write(fname);
4233
4234 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4235- if ((*it)->IsWritable())
4236- return (*it)->OpenStreamWrite(fname);
4237+ if ((*it)->is_writable())
4238+ return (*it)->open_stream_write(fname);
4239
4240 throw wexception("LayeredFileSystem: No writable filesystem!");
4241 }
4242@@ -195,27 +195,27 @@
4243 /**
4244 * MakeDir in first writable directory
4245 */
4246-void LayeredFileSystem::MakeDirectory(const std::string & dirname) {
4247- if (m_home && m_home->IsWritable())
4248- return m_home->MakeDirectory(dirname);
4249+void LayeredFileSystem::make_directory(const std::string & dirname) {
4250+ if (m_home && m_home->is_writable())
4251+ return m_home->make_directory(dirname);
4252
4253 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4254- if ((*it)->IsWritable())
4255- return (*it)->MakeDirectory(dirname);
4256+ if ((*it)->is_writable())
4257+ return (*it)->make_directory(dirname);
4258
4259 throw wexception("LayeredFileSystem: No writable filesystem!");
4260 }
4261
4262 /**
4263- * EnsureDirectoryExists in first writable directory
4264+ * ensure_directory_exists in first writable directory
4265 */
4266-void LayeredFileSystem::EnsureDirectoryExists(const std::string & dirname) {
4267- if (m_home && m_home->IsWritable())
4268- return m_home->EnsureDirectoryExists(dirname);
4269+void LayeredFileSystem::ensure_directory_exists(const std::string & dirname) {
4270+ if (m_home && m_home->is_writable())
4271+ return m_home->ensure_directory_exists(dirname);
4272
4273 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4274- if ((*it)->IsWritable())
4275- return (*it)->EnsureDirectoryExists(dirname);
4276+ if ((*it)->is_writable())
4277+ return (*it)->ensure_directory_exists(dirname);
4278
4279 throw wexception("LayeredFileSystem: No writable filesystem!");
4280 }
4281@@ -223,14 +223,14 @@
4282 /**
4283 * Create a subfilesystem from an existing file/directory
4284 */
4285-FileSystem * LayeredFileSystem::MakeSubFileSystem(const std::string & dirname)
4286+FileSystem * LayeredFileSystem::make_sub_file_system(const std::string & dirname)
4287 {
4288- if (m_home && m_home->IsWritable() && m_home->FileExists(dirname))
4289- return m_home->MakeSubFileSystem(dirname);
4290+ if (m_home && m_home->is_writable() && m_home->file_exists(dirname))
4291+ return m_home->make_sub_file_system(dirname);
4292
4293 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4294- if ((*it)->IsWritable() && (*it)->FileExists(dirname))
4295- return (*it)->MakeSubFileSystem(dirname);
4296+ if ((*it)->is_writable() && (*it)->file_exists(dirname))
4297+ return (*it)->make_sub_file_system(dirname);
4298
4299 throw wexception("LayeredFileSystem: unable to create sub filesystem");
4300 }
4301@@ -238,14 +238,14 @@
4302 /**
4303 * Create a subfilesystem from a new file/directory
4304 */
4305-FileSystem * LayeredFileSystem::CreateSubFileSystem(const std::string & dirname, Type const type)
4306+FileSystem * LayeredFileSystem::create_sub_file_system(const std::string & dirname, Type const type)
4307 {
4308- if (m_home && m_home->IsWritable() && !m_home->FileExists(dirname))
4309- return m_home->CreateSubFileSystem(dirname, type);
4310+ if (m_home && m_home->is_writable() && !m_home->file_exists(dirname))
4311+ return m_home->create_sub_file_system(dirname, type);
4312
4313 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4314- if ((*it)->IsWritable() && !(*it)->FileExists(dirname))
4315- return (*it)->CreateSubFileSystem(dirname, type);
4316+ if ((*it)->is_writable() && !(*it)->file_exists(dirname))
4317+ return (*it)->create_sub_file_system(dirname, type);
4318
4319 throw wexception("LayeredFileSystem: unable to create sub filesystem");
4320 }
4321@@ -253,33 +253,34 @@
4322 /**
4323 * Remove this file or directory. If it is a directory, remove it recursively
4324 */
4325-void LayeredFileSystem::Unlink(const std::string & file) {
4326- if (!FileExists(file))
4327+void LayeredFileSystem::fs_unlink(const std::string & file) {
4328+ if (!file_exists(file))
4329 return;
4330
4331- if (m_home && m_home->IsWritable() && m_home->FileExists(file)) {
4332- m_home->Unlink(file);
4333+ if (m_home && m_home->is_writable() && m_home->file_exists(file)) {
4334+ m_home->fs_unlink(file);
4335 return;
4336 }
4337+
4338 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4339- if ((*it)->IsWritable() && (*it)->FileExists(file)) {
4340- (*it)->Unlink(file);
4341+ if ((*it)->is_writable() && (*it)->file_exists(file)) {
4342+ (*it)->fs_unlink(file);
4343 return;
4344 }
4345 }
4346
4347-void LayeredFileSystem::Rename
4348+void LayeredFileSystem::fs_rename
4349 (const std::string & old_name, const std::string & new_name)
4350 {
4351- if (!FileExists(old_name))
4352+ if (!file_exists(old_name))
4353 return;
4354- if (m_home && m_home->IsWritable() && m_home->FileExists(old_name)) {
4355- m_home->Rename(old_name, new_name);
4356+ if (m_home && m_home->is_writable() && m_home->file_exists(old_name)) {
4357+ m_home->fs_rename(old_name, new_name);
4358 return;
4359 }
4360 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4361- if ((*it)->IsWritable() && (*it)->FileExists(old_name)) {
4362- (*it)->Rename(old_name, new_name);
4363+ if ((*it)->is_writable() && (*it)->file_exists(old_name)) {
4364+ (*it)->fs_rename(old_name, new_name);
4365 return;
4366 }
4367 }
4368@@ -288,12 +289,12 @@
4369 // or the first directory on the stack we can find.
4370 // This heuristic is justified by the fact that ths is
4371 // where we will create new files.
4372-unsigned long long LayeredFileSystem::DiskSpace() {
4373+unsigned long long LayeredFileSystem::disk_space() {
4374 if (m_home) {
4375- return m_home->DiskSpace();
4376+ return m_home->disk_space();
4377 }
4378 for (auto it = m_filesystems.rbegin(); it != m_filesystems.rend(); ++it)
4379 if (*it)
4380- return (*it)->DiskSpace();
4381+ return (*it)->disk_space();
4382 return 0;
4383 }
4384
4385=== modified file 'src/io/filesystem/layered_filesystem.h'
4386--- src/io/filesystem/layered_filesystem.h 2014-07-26 10:43:23 +0000
4387+++ src/io/filesystem/layered_filesystem.h 2014-09-29 14:39:47 +0000
4388@@ -50,37 +50,37 @@
4389
4390 // Add a new filesystem to the top of the stack. Take ownership of the given
4391 // filesystem.
4392- void AddFileSystem(FileSystem*);
4393+ void add_file_system(FileSystem*);
4394
4395 // Set the home filesystem (which is the preferred filesystem for writing
4396 // files). Take ownership of the given filesystem.
4397- void SetHomeFileSystem(FileSystem*);
4398-
4399- virtual void RemoveFileSystem(const FileSystem &);
4400-
4401- std::set<std::string> ListDirectory(const std::string& path) override;
4402-
4403- bool IsWritable() const override;
4404- bool FileExists(const std::string & path) override;
4405- bool IsDirectory (const std::string & path) override;
4406- void EnsureDirectoryExists(const std::string & dirname) override;
4407- void MakeDirectory (const std::string & dirname) override;
4408-
4409- void * Load(const std::string & fname, size_t & length) override;
4410- virtual void Write
4411+ void set_home_file_system(FileSystem*);
4412+
4413+ virtual void remove_file_system(const FileSystem &);
4414+
4415+ std::set<std::string> list_directory(const std::string& path) override;
4416+
4417+ bool is_writable () const override;
4418+ bool file_exists (const std::string & path) override;
4419+ bool is_directory (const std::string & path) override;
4420+ void ensure_directory_exists(const std::string & fs_dirname) override;
4421+ void make_directory (const std::string & fs_dirname) override;
4422+
4423+ void * load(const std::string & fname, size_t & length) override;
4424+ virtual void write
4425 (const std::string & fname, void const * data, int32_t length) override;
4426
4427- StreamRead * OpenStreamRead (const std::string & fname) override;
4428- StreamWrite * OpenStreamWrite(const std::string & fname) override;
4429-
4430- FileSystem * MakeSubFileSystem(const std::string & dirname) override;
4431- FileSystem * CreateSubFileSystem(const std::string & dirname, Type) override;
4432- void Unlink(const std::string & file) override;
4433- void Rename(const std::string &, const std::string &) override;
4434-
4435- std::string getBasename() override {return std::string();}
4436-
4437- unsigned long long DiskSpace() override;
4438+ StreamRead * open_stream_read (const std::string & fname) override;
4439+ StreamWrite * open_stream_write(const std::string & fname) override;
4440+
4441+ FileSystem * make_sub_file_system(const std::string & fs_dirname) override;
4442+ FileSystem * create_sub_file_system(const std::string & fs_dirname, Type) override;
4443+ void fs_unlink(const std::string & file) override;
4444+ void fs_rename(const std::string &, const std::string &) override;
4445+
4446+ std::string get_basename() override {return std::string();}
4447+
4448+ unsigned long long disk_space() override;
4449
4450 private:
4451 std::vector<std::unique_ptr<FileSystem>> m_filesystems;
4452
4453=== modified file 'src/io/filesystem/test/test_filesystem.cc'
4454--- src/io/filesystem/test/test_filesystem.cc 2014-07-14 10:45:44 +0000
4455+++ src/io/filesystem/test/test_filesystem.cc 2014-09-29 14:39:47 +0000
4456@@ -34,7 +34,7 @@
4457 if (!s.empty() && s[0] == '\\')
4458 {
4459 // Insert drive letter part from current working directory
4460- std::string cwd = RealFSImpl("").getWorkingDirectory();
4461+ std::string cwd = RealFSImpl("").get_working_directory();
4462 s.insert(0, cwd.substr(0, 2));
4463 }
4464 return s;
4465@@ -53,15 +53,15 @@
4466 BOOST_AUTO_TEST_SUITE(FileSystemTests)
4467 #ifndef _WIN32
4468 #define TEST_CANONICALIZE_NAME(root, path, expected) \
4469- BOOST_CHECK_EQUAL(RealFSImpl(root).FS_CanonicalizeName(path), expected);
4470+ BOOST_CHECK_EQUAL(RealFSImpl(root).canonicalize_name(path), expected);
4471 #else
4472 #define TEST_CANONICALIZE_NAME(root, path, expected) \
4473- BOOST_CHECK_EQUAL(RealFSImpl(Win32Path(root)).FS_CanonicalizeName(path), Win32Path(expected));
4474+ BOOST_CHECK_EQUAL(RealFSImpl(Win32Path(root)).canonicalize_name(path), Win32Path(expected));
4475 #endif
4476
4477 BOOST_AUTO_TEST_CASE(test_canonicalize_name) {
4478 setenv("HOME", "/home/test", 1);
4479- std::string cwd = RealFSImpl("").getWorkingDirectory();
4480+ std::string cwd = RealFSImpl("").get_working_directory();
4481
4482 // RealFSImpl is constructed with a root directory...
4483
4484@@ -128,8 +128,8 @@
4485
4486 #ifdef _WIN32
4487 // Check drive letter handling.
4488- BOOST_CHECK_EQUAL(RealFSImpl("C:\\").FS_CanonicalizeName("C:\\"), "C:");
4489- BOOST_CHECK_EQUAL(RealFSImpl("C:\\").FS_CanonicalizeName("D:\\"), "C:\\D:");
4490+ BOOST_CHECK_EQUAL(RealFSImpl("C:\\").canonicalize_name("C:\\"), "C:");
4491+ BOOST_CHECK_EQUAL(RealFSImpl("C:\\").canonicalize_name("D:\\"), "C:\\D:");
4492 #endif
4493 }
4494
4495@@ -138,7 +138,7 @@
4496 // ~ gets expanded to $HOME
4497 BOOST_AUTO_TEST_CASE(test_canonicalize_name_home_expansion) {
4498 setenv("HOME", "/my/home", 1);
4499- std::string cwd = RealFSImpl("").getWorkingDirectory();
4500+ std::string cwd = RealFSImpl("").get_working_directory();
4501
4502 TEST_CANONICALIZE_NAME("~", "path", "/my/home/path");
4503 TEST_CANONICALIZE_NAME("~/test", "path", "/my/home/test/path");
4504
4505=== modified file 'src/io/filesystem/zip_exceptions.h'
4506--- src/io/filesystem/zip_exceptions.h 2014-09-10 13:03:40 +0000
4507+++ src/io/filesystem/zip_exceptions.h 2014-09-29 14:39:47 +0000
4508@@ -27,7 +27,7 @@
4509 *
4510 * Problems with the zipfile itself or normal file operations should throw
4511 * FileError or one of it's descendants with an appropriate message. E.g.:
4512- * throw FileNotFoundError("ZipFilesystem::Load", fname,
4513+ * throw FileNotFoundError("ZipFilesystem::load", fname,
4514 * "couldn't open file (from zipfile "+m_zipfilename+")");
4515 */
4516 struct ZipOperationError : public std::logic_error {
4517
4518=== modified file 'src/io/filesystem/zip_filesystem.cc'
4519--- src/io/filesystem/zip_filesystem.cc 2014-09-10 13:03:40 +0000
4520+++ src/io/filesystem/zip_filesystem.cc 2014-09-29 14:39:47 +0000
4521@@ -43,7 +43,7 @@
4522 m_unzipfile (nullptr),
4523 m_oldzip (false),
4524 m_zipfilename(zipfile),
4525-m_basenamezip(FS_Filename(zipfile.c_str())),
4526+m_basenamezip(fs_filename(zipfile.c_str())),
4527 m_basename ()
4528 {
4529 // TODO(unknown): check OS permissions on whether the file is writable
4530@@ -54,13 +54,13 @@
4531 */
4532 ZipFilesystem::~ZipFilesystem()
4533 {
4534- m_Close();
4535+ m_close();
4536 }
4537
4538 /**
4539 * Return true if this directory is writable.
4540 */
4541-bool ZipFilesystem::IsWritable() const {
4542+bool ZipFilesystem::is_writable() const {
4543 return true; // should be checked in constructor
4544 }
4545
4546@@ -69,8 +69,8 @@
4547 * pathname) in the results. There doesn't seem to be an even remotely
4548 * cross-platform way of doing this
4549 */
4550-std::set<std::string> ZipFilesystem::ListDirectory(const std::string& path_in) {
4551- m_OpenUnzip();
4552+std::set<std::string> ZipFilesystem::list_directory(const std::string& path_in) {
4553+ m_open_unzip();
4554
4555 assert(path_in.size()); // prevent invalid read below
4556
4557@@ -95,7 +95,7 @@
4558 nullptr, 0, nullptr, 0);
4559
4560 std::string complete_filename = strip_basename(filename_inzip);
4561- std::string filename = FS_Filename(complete_filename.c_str());
4562+ std::string filename = fs_filename(complete_filename.c_str());
4563 std::string filepath =
4564 complete_filename.substr
4565 (0, complete_filename.size() - filename.size());
4566@@ -118,9 +118,9 @@
4567 * Returns true if the given file exists, and false if it doesn't.
4568 * Also returns false if the pathname is invalid
4569 */
4570-bool ZipFilesystem::FileExists(const std::string & path) {
4571+bool ZipFilesystem::file_exists(const std::string & path) {
4572 try {
4573- m_OpenUnzip(); // TODO(unknown): check return value
4574+ m_open_unzip(); // TODO(unknown): check return value
4575 } catch (...) {
4576 return false;
4577 }
4578@@ -159,9 +159,9 @@
4579 * Returns true if the given file is a directory, and false if it doesn't.
4580 * Also returns false if the pathname is invalid
4581 */
4582-bool ZipFilesystem::IsDirectory(const std::string & path) {
4583+bool ZipFilesystem::is_directory(const std::string & path) {
4584
4585- if (!FileExists(path))
4586+ if (!file_exists(path))
4587 return false;
4588
4589 unz_file_info file_info;
4590@@ -177,13 +177,13 @@
4591 /**
4592 * Create a sub filesystem out of this filesystem
4593 */
4594-FileSystem * ZipFilesystem::MakeSubFileSystem(const std::string & path) {
4595- m_OpenUnzip();
4596-
4597- assert(FileExists(path));
4598- assert(IsDirectory(path));
4599-
4600- m_Close();
4601+FileSystem * ZipFilesystem::make_sub_file_system(const std::string & path) {
4602+ m_open_unzip();
4603+
4604+ assert(file_exists(path));
4605+ assert(is_directory(path));
4606+
4607+ m_close();
4608
4609 std::string localpath = path;
4610
4611@@ -201,20 +201,20 @@
4612 * \throw ZipOperationError
4613 */
4614 // TODO(unknown): type should be recognized automatically,
4615-// see Filesystem::Create
4616-FileSystem * ZipFilesystem::CreateSubFileSystem(const std::string & path, Type const type)
4617+// see Filesystem::create
4618+FileSystem * ZipFilesystem::create_sub_file_system(const std::string & path, Type const type)
4619 {
4620- assert(!FileExists(path));
4621+ assert(!file_exists(path));
4622
4623 if (type != FileSystem::DIR)
4624 throw ZipOperationError
4625- ("ZipFilesystem::CreateSubFileSystem",
4626+ ("ZipFilesystem::create_sub_file_system",
4627 path, m_zipfilename,
4628 "can not create ZipFilesystem inside another ZipFilesystem");
4629
4630- EnsureDirectoryExists(path);
4631+ ensure_directory_exists(path);
4632
4633- m_Close();
4634+ m_close();
4635
4636 std::string localpath = path;
4637
4638@@ -231,9 +231,9 @@
4639 * Remove a number of files
4640 * \throw ZipOperationError
4641 */
4642-void ZipFilesystem::Unlink(const std::string & filename) {
4643+void ZipFilesystem::fs_unlink(const std::string & filename) {
4644 throw ZipOperationError
4645- ("ZipFilesystem::Unlink",
4646+ ("ZipFilesystem::unlink",
4647 filename,
4648 m_zipfilename,
4649 "unlinking is not supported inside zipfiles");
4650@@ -243,11 +243,11 @@
4651 * Create this directory if it doesn't exist, throws an error
4652 * if the dir can't be created or if a file with this name exists
4653 */
4654-void ZipFilesystem::EnsureDirectoryExists(const std::string & dirname) {
4655- if (FileExists(dirname) && IsDirectory(dirname))
4656+void ZipFilesystem::ensure_directory_exists(const std::string & dirname) {
4657+ if (file_exists(dirname) && is_directory(dirname))
4658 return;
4659
4660- MakeDirectory(dirname);
4661+ make_directory(dirname);
4662 }
4663
4664 /**
4665@@ -255,11 +255,11 @@
4666 * if a file is in the way or if the creation fails.
4667 *
4668 * Pleas note, this function does not honor parents,
4669- * MakeDirectory("onedir/otherdir/onemoredir") will fail
4670+ * make_directory("onedir/otherdir/onemoredir") will fail
4671 * if either ondir or otherdir is missing
4672 */
4673-void ZipFilesystem::MakeDirectory(const std::string & dirname) {
4674- m_OpenZip();
4675+void ZipFilesystem::make_directory(const std::string & dirname) {
4676+ m_open_zip();
4677
4678 zip_fileinfo zi;
4679
4680@@ -296,23 +296,23 @@
4681 break;
4682 case ZIP_ERRNO:
4683 throw FileError
4684- ("ZipFilesystem::MakeDirectory", complete_filename, strerror(errno));
4685+ ("ZipFilesystem::make_directory", complete_filename, strerror(errno));
4686 default:
4687 throw FileError
4688- ("ZipFilesystem::MakeDirectory", complete_filename);
4689+ ("ZipFilesystem::make_directory", complete_filename);
4690 }
4691
4692 zipCloseFileInZip(m_zipfile);
4693 }
4694
4695 /**
4696- * Read the given file into alloced memory; called by FileRead::Open.
4697+ * Read the given file into alloced memory; called by FileRead::open.
4698 * \throw FileNotFoundError if the file couldn't be opened.
4699 */
4700-void * ZipFilesystem::Load(const std::string & fname, size_t & length) {
4701- if (!FileExists(fname.c_str()) || IsDirectory(fname.c_str()))
4702+void * ZipFilesystem::load(const std::string & fname, size_t & length) {
4703+ if (!file_exists(fname.c_str()) || is_directory(fname.c_str()))
4704 throw ZipOperationError
4705- ("ZipFilesystem::Load",
4706+ ("ZipFilesystem::load",
4707 fname,
4708 m_zipfilename,
4709 "could not open file from zipfile");
4710@@ -330,7 +330,7 @@
4711 char buf[200];
4712 snprintf(buf, sizeof(buf), "read error %i", len);
4713 throw ZipOperationError
4714- ("ZipFilesystem::Load",
4715+ ("ZipFilesystem::load",
4716 fname,
4717 m_zipfilename,
4718 buf);
4719@@ -357,13 +357,13 @@
4720 * Write the given block of memory to the repository.
4721 * Throws an exception if it fails.
4722 */
4723-void ZipFilesystem::Write
4724+void ZipFilesystem::write
4725 (const std::string & fname, void const * const data, int32_t const length)
4726 {
4727 std::string filename = fname;
4728 std::replace(filename.begin(), filename.end(), '\\', '/');
4729
4730- m_OpenZip();
4731+ m_open_zip();
4732
4733 zip_fileinfo zi;
4734
4735@@ -389,7 +389,7 @@
4736 break;
4737 default:
4738 throw ZipOperationError
4739- ("ZipFilesystem::Write", complete_filename, m_zipfilename);
4740+ ("ZipFilesystem::write", complete_filename, m_zipfilename);
4741 }
4742
4743 switch (zipWriteInFileInZip (m_zipfile, data, length)) {
4744@@ -397,10 +397,10 @@
4745 break;
4746 case ZIP_ERRNO:
4747 throw FileError
4748- ("ZipFilesystem::Write", complete_filename, strerror(errno));
4749+ ("ZipFilesystem::write", complete_filename, strerror(errno));
4750 default:
4751 throw FileError
4752- ("ZipFilesystem::Write", complete_filename);
4753+ ("ZipFilesystem::write", complete_filename);
4754 }
4755
4756 zipCloseFileInZip(m_zipfile);
4757@@ -413,12 +413,12 @@
4758 ZipFilesystem::ZipStreamRead::ZipStreamRead(zipFile file, ZipFilesystem* zipfs)
4759 : m_unzipfile(file), m_zipfs(zipfs) {}
4760 ZipFilesystem::ZipStreamRead::~ZipStreamRead() {
4761- m_zipfs->m_Close();
4762+ m_zipfs->m_close();
4763 }
4764
4765-size_t ZipFilesystem::ZipStreamRead::Data(void* data, size_t bufsize)
4766+size_t ZipFilesystem::ZipStreamRead::data(void* read_data, size_t bufsize)
4767 {
4768- int copied = unzReadCurrentFile(m_unzipfile, data, bufsize);
4769+ int copied = unzReadCurrentFile(m_unzipfile, read_data, bufsize);
4770 if (copied < 0) {
4771 throw new DataError("Failed to read from zip file");
4772 }
4773@@ -427,21 +427,21 @@
4774 }
4775 return copied;
4776 }
4777-bool ZipFilesystem::ZipStreamRead::EndOfFile() const
4778+bool ZipFilesystem::ZipStreamRead::end_of_file() const
4779 {
4780 return unzReadCurrentFile(m_unzipfile, nullptr, 1) == 0;
4781 }
4782
4783-StreamRead* ZipFilesystem::OpenStreamRead(const std::string& fname) {
4784- if (!FileExists(fname.c_str()) || IsDirectory(fname.c_str()))
4785+StreamRead* ZipFilesystem::open_stream_read(const std::string& fname) {
4786+ if (!file_exists(fname.c_str()) || is_directory(fname.c_str()))
4787 throw ZipOperationError
4788- ("ZipFilesystem::Load",
4789+ ("ZipFilesystem::load",
4790 fname,
4791 m_zipfilename,
4792 "could not open file from zipfile");
4793
4794 int32_t method;
4795- m_OpenUnzip();
4796+ m_open_unzip();
4797 int result = unzOpenCurrentFile3(m_unzipfile, &method, nullptr, 1, nullptr);
4798 switch (result) {
4799 case ZIP_OK:
4800@@ -461,12 +461,12 @@
4801 : m_zipfile(file), m_zipfs(zipfs) {}
4802 ZipFilesystem::ZipStreamWrite::~ZipStreamWrite()
4803 {
4804- m_zipfs->m_Close();
4805+ m_zipfs->m_close();
4806 }
4807
4808-void ZipFilesystem::ZipStreamWrite::Data(const void* const data, const size_t size)
4809+void ZipFilesystem::ZipStreamWrite::data(const void* const write_data, const size_t size)
4810 {
4811- int result = zipWriteInFileInZip(m_zipfile, data, size);
4812+ int result = zipWriteInFileInZip(m_zipfile, write_data, size);
4813 switch (result) {
4814 case ZIP_OK:
4815 break;
4816@@ -475,8 +475,8 @@
4817 }
4818 }
4819
4820-StreamWrite * ZipFilesystem::OpenStreamWrite(const std::string & fname) {
4821- m_OpenZip();
4822+StreamWrite * ZipFilesystem::open_stream_write(const std::string & fname) {
4823+ m_open_zip();
4824
4825 zip_fileinfo zi;
4826
4827@@ -510,7 +510,7 @@
4828 /**
4829 * Private Functions below
4830 */
4831-void ZipFilesystem::m_Close() {
4832+void ZipFilesystem::m_close() {
4833 if (m_state == STATE_ZIPPING)
4834 zipClose(m_zipfile, nullptr);
4835 else if (m_state == STATE_UNZIPPPING)
4836@@ -522,11 +522,11 @@
4837 /**
4838 * Open a zipfile for compressing
4839 */
4840-void ZipFilesystem::m_OpenZip() {
4841+void ZipFilesystem::m_open_zip() {
4842 if (m_state == STATE_ZIPPING)
4843 return;
4844
4845- m_Close();
4846+ m_close();
4847
4848 m_zipfile = zipOpen(m_zipfilename.c_str(), APPEND_STATUS_ADDINZIP);
4849 if (!m_zipfile) {
4850@@ -541,25 +541,25 @@
4851 * Open a zipfile for extraction
4852 * \throw FileTypeError
4853 */
4854-void ZipFilesystem::m_OpenUnzip() {
4855+void ZipFilesystem::m_open_unzip() {
4856 if (m_state == STATE_UNZIPPPING)
4857 return;
4858
4859- m_Close();
4860+ m_close();
4861
4862 m_unzipfile = unzOpen(m_zipfilename.c_str());
4863 if (!m_unzipfile)
4864 throw FileTypeError
4865- ("ZipFilesystem::m_OpenUnzip", m_zipfilename, "not a .zip file");
4866+ ("ZipFilesystem::m_open_unzip", m_zipfilename, "not a .zip file");
4867
4868 m_state = STATE_UNZIPPPING;
4869 }
4870
4871-void ZipFilesystem::Rename(const std::string &, const std::string &) {
4872+void ZipFilesystem::fs_rename(const std::string &, const std::string &) {
4873 throw wexception("rename inside zip FS is not implemented yet");
4874 }
4875
4876-unsigned long long ZipFilesystem::DiskSpace() {
4877+unsigned long long ZipFilesystem::disk_space() {
4878 return 0;
4879 }
4880
4881
4882=== modified file 'src/io/filesystem/zip_filesystem.h'
4883--- src/io/filesystem/zip_filesystem.h 2014-07-26 10:43:23 +0000
4884+++ src/io/filesystem/zip_filesystem.h 2014-09-29 14:39:47 +0000
4885@@ -35,40 +35,40 @@
4886 explicit ZipFilesystem(const std::string &);
4887 virtual ~ZipFilesystem();
4888
4889- bool IsWritable() const override;
4890-
4891- std::set<std::string> ListDirectory(const std::string& path) override;
4892-
4893- bool IsDirectory(const std::string & path) override;
4894- bool FileExists (const std::string & path) override;
4895-
4896- void * Load(const std::string & fname, size_t & length) override;
4897-
4898- virtual void Write
4899+ bool is_writable() const override;
4900+
4901+ std::set<std::string> list_directory(const std::string& path) override;
4902+
4903+ bool is_directory(const std::string & path) override;
4904+ bool file_exists (const std::string & path) override;
4905+
4906+ void * load(const std::string & fname, size_t & length) override;
4907+
4908+ virtual void write
4909 (const std::string & fname, void const * data, int32_t length) override;
4910- void EnsureDirectoryExists(const std::string & dirname) override;
4911- void MakeDirectory (const std::string & dirname) override;
4912-
4913- virtual StreamRead * OpenStreamRead
4914- (const std::string & fname) override;
4915- virtual StreamWrite * OpenStreamWrite
4916- (const std::string & fname) override;
4917-
4918- FileSystem * MakeSubFileSystem(const std::string & dirname) override;
4919- FileSystem * CreateSubFileSystem(const std::string & dirname, Type) override;
4920- void Unlink(const std::string & filename) override;
4921- void Rename(const std::string &, const std::string &) override;
4922-
4923- unsigned long long DiskSpace() override;
4924-
4925- static FileSystem * CreateFromDirectory(const std::string & directory);
4926-
4927- std::string getBasename() override {return m_zipfilename;}
4928+ void ensure_directory_exists(const std::string & fs_dirname) override;
4929+ void make_directory (const std::string & fs_dirname) override;
4930+
4931+ virtual StreamRead * open_stream_read
4932+ (const std::string & fname) override;
4933+ virtual StreamWrite * open_stream_write
4934+ (const std::string & fname) override;
4935+
4936+ FileSystem * make_sub_file_system(const std::string & fs_dirname) override;
4937+ FileSystem * create_sub_file_system(const std::string & fs_dirname, Type) override;
4938+ void fs_unlink(const std::string & fs_filename) override;
4939+ void fs_rename(const std::string &, const std::string &) override;
4940+
4941+ unsigned long long disk_space() override;
4942+
4943+ static FileSystem * create_from_directory(const std::string & directory);
4944+
4945+ std::string get_basename() override {return m_zipfilename;}
4946
4947 protected:
4948- void m_OpenUnzip();
4949- void m_OpenZip();
4950- void m_Close();
4951+ void m_open_unzip();
4952+ void m_open_zip();
4953+ void m_close();
4954 std::string strip_basename(std::string);
4955
4956 enum State {
4957@@ -90,8 +90,8 @@
4958 struct ZipStreamRead : StreamRead {
4959 explicit ZipStreamRead(zipFile file, ZipFilesystem* zipfs);
4960 virtual ~ZipStreamRead();
4961- size_t Data(void* data, size_t bufsize) override;
4962- bool EndOfFile() const override;
4963+ size_t data(void* data, size_t bufsize) override;
4964+ bool end_of_file() const override;
4965 private:
4966 zipFile m_unzipfile;
4967 ZipFilesystem* m_zipfs;
4968@@ -99,7 +99,7 @@
4969 struct ZipStreamWrite : StreamWrite {
4970 explicit ZipStreamWrite(zipFile file, ZipFilesystem* zipfs);
4971 virtual ~ZipStreamWrite();
4972- void Data(const void* const data, size_t size) override;
4973+ void data(const void* const data, size_t size) override;
4974 private:
4975 zipFile m_zipfile;
4976 ZipFilesystem* m_zipfs;
4977
4978=== modified file 'src/io/filewrite.cc'
4979--- src/io/filewrite.cc 2014-07-20 07:44:22 +0000
4980+++ src/io/filewrite.cc 2014-09-29 14:39:47 +0000
4981@@ -26,39 +26,39 @@
4982 }
4983
4984 FileWrite::~FileWrite() {
4985- Clear();
4986+ clear();
4987 }
4988
4989-void FileWrite::Clear() {
4990+void FileWrite::clear() {
4991 free(data_);
4992 data_ = nullptr;
4993 length_ = max_size_ = 0;
4994 filepos_ = 0;
4995 }
4996
4997-void FileWrite::Write(FileSystem& fs, char const* const filename) {
4998- fs.Write(filename, data_, length_);
4999- Clear();
5000-}
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: