Comments (5)
- Leave things as they are. After all it works and there are no extra external dependencies.
Has the benefit of trading an external dependency for maintainability.
- Switch to Boost Filesystem. Makes some code cleanups possible. Introduces external dependency. But C++ standard "File System TS" will be very similar to Boost Filesystem, so change later should be very easy.
Boost.Filesystem is very easy to work with. It is used all over the place in OSRM. Unfortunately, there is no light-weight header-only variant of it.
Wait for C++ "File System TS", which is in the works and will probably released sometime this year. It might take a while to get implemented everywhere though.
Sounds like option 1 with the later possibility of switching. ๐
Would it make sense to go with option 1 (or 3) and encapsulate the platform-dependent code into a separate header file?
from libosmium.
ะจI am not an expert. Boost filesystem is good and easy enough, but to encourage usage of Osmium it is better to have fewer dependencies that are small and easy to build/install. OSRM is a big-executable project for running mainly on server, so extra dependency and 500kb does not matter. Osmium-based utilities are smaller.
So I would separate the platform-dependent code and use ifdefs for now, and later switch to option 3.
I would even consider redistributing already needed part of boost together with libosmium :)
from libosmium.
Right, OSRM already uses boost in plenty of places. It didn't introduce another dependency.
from libosmium.
few ifdefs seem fine, but of any boost dependencies I found filesystem quite manageable. In Mapnik we've kept most of the usage hidden from headers in case we need to switch it out for some platform: https://github.com/mapnik/mapnik/blob/master/src/fs.cpp
from libosmium.
Thanks for all your comments. I'll keep things as they are for the time being. There aren't that many filesystem interactions and any attempt to factor out some code or use the boost filesystem library would probably make the code worse instead of better.
Looking at the Mapnik code that @springmeyer linked to, I have to ask myself why I want a library that is specifically made to hide operating system differences when every call to that library has to be wrapped with another function that is compiled differently depening on the OS.
from libosmium.
Related Issues (20)
- Unable to compile with c++20 when using precompiled binaries HOT 8
- Failing to compile libosmium: 'protozero/types.hpp' file not found HOT 5
- Incorrect proj usage HOT 1
- libosmium no longer successfully builds after `v2.17.1` on CentOS 7 HOT 2
- Need help, how to add altitude to libosmium HOT 2
- Missing prepare_for_lookup in test_members_database.cpp HOT 1
- heads-up: PROJ_LIB is now deprecated (use PROJ_DATA instead)
- io_test_bzip2 fails on Alpine Linux HOT 3
- AppVeyor builds fail due to missing LZ4 HOT 5
- Print offending string in PBF-Decoder
- installation make error HOT 2
- Does libosmium work with MacOS (M series chip)
- Performance Issues with `timegm` called from `parse_timestamp` on iOS 16.2 HOT 10
- Fractional seconds in XML timestamps HOT 2
- compiler error HOT 4
- What is the best practice for writing CPU-intensive handlers? HOT 4
- Reader class cannot record file types HOT 1
- Fails to read a bz2 file HOT 1
- location for one or more nodes not found in node location index HOT 2
- windows build is failing according to https://osmcode.org/status.html HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libosmium.