osrm-backend/third_party/libosmium/include/osmium/memory/buffer.hpp

782 lines
30 KiB
C++
Raw Normal View History

#ifndef OSMIUM_MEMORY_BUFFER_HPP
#define OSMIUM_MEMORY_BUFFER_HPP
/*
This file is part of Osmium (http://osmcode.org/libosmium).
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
Copyright 2013-2018 Jochen Topf <jochen@topf.org> and others (see README).
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
#include <osmium/memory/item.hpp>
#include <osmium/memory/item_iterator.hpp>
#include <osmium/osm/entity.hpp>
#include <osmium/util/compatibility.hpp>
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <functional>
#include <iterator>
#include <memory>
#include <stdexcept>
#include <utility>
namespace osmium {
/**
* Exception thrown by the osmium::memory::Buffer class when somebody tries
* to write data into a buffer and it doesn't fit. Buffers with internal
* memory management will not throw this exception, but increase their size.
*/
struct buffer_is_full : public std::runtime_error {
buffer_is_full() :
std::runtime_error{"Osmium buffer is full"} {
}
}; // struct buffer_is_full
/**
* @brief Memory management of items in buffers and iterators over this data.
*/
namespace memory {
/**
* A memory area for storing OSM objects and other items. Each item stored
* has a type and a length. See the Item class for details.
*
* Data can be added to a buffer piece by piece using reserve_space() and
* add_item(). After all data that together forms an item is added, it must
* be committed using the commit() call. Usually this is done through the
* Builder class and its derived classes.
*
* You can iterate over all items in a buffer using the iterators returned
* by begin(), end(), cbegin(), and cend().
*
* Buffers exist in two flavours, those with external memory management and
* those with internal memory management. If you already have some memory
* with data in it (for instance read from disk), you create a Buffer with
* external memory management. It is your job then to free the memory once
* the buffer isn't used any more. If you don't have memory already, you can
* create a Buffer object and have it manage the memory internally. It will
* dynamically allocate memory and free it again after use.
*
* By default, if a buffer gets full it will throw a buffer_is_full exception.
* You can use the set_full_callback() method to set a callback functor
* which will be called instead of throwing an exception. The full
* callback functionality is deprecated and will be removed in the
* future. See the documentation for set_full_callback() for alternatives.
*/
class Buffer {
public:
// This is needed so we can call std::back_inserter() on a Buffer.
using value_type = Item;
enum class auto_grow : bool {
yes = true,
no = false
}; // enum class auto_grow
private:
std::unique_ptr<unsigned char[]> m_memory;
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
unsigned char* m_data = nullptr;
std::size_t m_capacity = 0;
std::size_t m_written = 0;
std::size_t m_committed = 0;
#ifndef NDEBUG
uint8_t m_builder_count = 0;
#endif
auto_grow m_auto_grow{auto_grow::no};
std::function<void(Buffer&)> m_full;
static std::size_t calculate_capacity(std::size_t capacity) noexcept {
// The majority of all Nodes will fit into this size.
constexpr static const std::size_t min_capacity = 64;
if (capacity < min_capacity) {
return min_capacity;
}
return padded_length(capacity);
}
public:
/**
* The constructor without any parameters creates an invalid,
* buffer, ie an empty hull of a buffer that has no actual memory
* associated with it. It can be used to signify end-of-data.
*
* Most methods of the Buffer class will not work with an invalid
* buffer.
*/
Buffer() noexcept :
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
m_memory() {
}
/**
* Constructs a valid externally memory-managed buffer using the
* given memory and size.
*
* @param data A pointer to some already initialized data.
* @param size The size of the initialized data.
*
* @throws std::invalid_argument if the size isn't a multiple of
* the alignment.
*/
explicit Buffer(unsigned char* data, std::size_t size) :
m_memory(),
m_data(data),
m_capacity(size),
m_written(size),
m_committed(size) {
if (size % align_bytes != 0) {
throw std::invalid_argument{"buffer size needs to be multiple of alignment"};
}
}
/**
* Constructs a valid externally memory-managed buffer with the
* given capacity that already contains 'committed' bytes of data.
*
* @param data A pointer to some (possibly initialized) data.
* @param capacity The size of the memory for this buffer.
* @param committed The size of the initialized data. If this is 0, the buffer startes out empty.
*
* @throws std::invalid_argument if the capacity or committed isn't
* a multiple of the alignment or if committed is larger
* than capacity.
*/
explicit Buffer(unsigned char* data, std::size_t capacity, std::size_t committed) :
m_memory(),
m_data(data),
m_capacity(capacity),
m_written(committed),
m_committed(committed) {
if (capacity % align_bytes != 0) {
throw std::invalid_argument{"buffer capacity needs to be multiple of alignment"};
}
if (committed % align_bytes != 0) {
throw std::invalid_argument{"buffer parameter 'committed' needs to be multiple of alignment"};
}
if (committed > capacity) {
throw std::invalid_argument{"buffer parameter 'committed' can not be larger than capacity"};
}
}
/**
* Constructs a valid internally memory-managed buffer with the
* given capacity.
* Will internally get dynamic memory of the required size.
* The dynamic memory will be automatically freed when the Buffer
* is destroyed.
*
* @param capacity The (initial) size of the memory for this buffer.
* Actual capacity might be larger tue to alignment.
* @param auto_grow Should this buffer automatically grow when it
* becomes to small?
*/
explicit Buffer(std::size_t capacity, auto_grow auto_grow = auto_grow::yes) :
m_memory(new unsigned char[calculate_capacity(capacity)]),
m_data(m_memory.get()),
m_capacity(calculate_capacity(capacity)),
m_auto_grow(auto_grow) {
}
// buffers can not be copied
Buffer(const Buffer&) = delete;
Buffer& operator=(const Buffer&) = delete;
// buffers can be moved
Buffer(Buffer&&) = default;
Buffer& operator=(Buffer&&) = default;
~Buffer() = default;
#ifndef NDEBUG
void increment_builder_count() noexcept {
++m_builder_count;
}
void decrement_builder_count() noexcept {
assert(m_builder_count > 0);
--m_builder_count;
}
uint8_t builder_count() const noexcept {
return m_builder_count;
}
#endif
/**
* Return a pointer to data inside the buffer.
*
* @pre The buffer must be valid.
*/
unsigned char* data() const noexcept {
assert(m_data && "This must be a valid buffer");
return m_data;
}
/**
* Returns the capacity of the buffer, ie how many bytes it can
* contain. Always returns 0 on invalid buffers.
*/
std::size_t capacity() const noexcept {
return m_capacity;
}
/**
* Returns the number of bytes already filled in this buffer.
* Always returns 0 on invalid buffers.
*/
std::size_t committed() const noexcept {
return m_committed;
}
/**
* Returns the number of bytes currently filled in this buffer that
* are not yet committed.
* Always returns 0 on invalid buffers.
*/
std::size_t written() const noexcept {
return m_written;
}
/**
* This tests if the current state of the buffer is aligned
* properly. Can be used for asserts.
*
* @pre The buffer must be valid.
*/
bool is_aligned() const noexcept {
assert(m_data && "This must be a valid buffer");
return (m_written % align_bytes == 0) && (m_committed % align_bytes == 0);
}
/**
* Set functor to be called whenever the buffer is full
* instead of throwing buffer_is_full.
*
* The behaviour is undefined if you call this on an invalid
* buffer.
*
* @pre The buffer must be valid.
*
* @deprecated
* Callback functionality will be removed in the future. Either
* detect the buffer_is_full exception or use a buffer with
* auto_grow::yes. If you want to avoid growing buffers, check
* the CallbackBuffer class.
*/
OSMIUM_DEPRECATED void set_full_callback(const std::function<void(Buffer&)>& full) {
assert(m_data && "This must be a valid buffer");
m_full = full;
}
/**
* Grow capacity of this buffer to the given size (which will be
* rounded up to the alignment needed).
* This works only with internally memory-managed buffers.
* If the given size is not larger than the current capacity,
* nothing is done.
*
* @pre The buffer must be valid.
*
* @param size New capacity.
*
* @throws std::logic_error if the buffer doesn't use internal
* memory management.
* @throws std::bad_alloc if there isn't enough memory available.
*/
void grow(std::size_t size) {
assert(m_data && "This must be a valid buffer");
if (!m_memory) {
throw std::logic_error{"Can't grow Buffer if it doesn't use internal memory management."};
}
size = calculate_capacity(size);
if (m_capacity < size) {
std::unique_ptr<unsigned char[]> memory(new unsigned char[size]);
std::copy_n(m_memory.get(), m_capacity, memory.get());
using std::swap;
swap(m_memory, memory);
m_data = m_memory.get();
m_capacity = size;
}
}
/**
* Mark currently written bytes in the buffer as committed.
*
* @pre The buffer must be valid.
* @pre The buffer must be aligned properly (as indicated
* by is_aligned().
* @pre No builder can be open on this buffer.
*
* @returns Number of committed bytes before this commit. Can be
* used as an offset into the buffer to get to the
* object being committed by this call.
*/
std::size_t commit() {
assert(m_data && "This must be a valid buffer");
assert(m_builder_count == 0 && "Make sure there are no Builder objects still in scope");
assert(is_aligned());
const std::size_t offset = m_committed;
m_committed = m_written;
return offset;
}
/**
* Roll back changes in buffer to last committed state.
*
* @pre The buffer must be valid.
* @pre No builder can be open on this buffer.
*/
void rollback() {
assert(m_data && "This must be a valid buffer");
assert(m_builder_count == 0 && "Make sure there are no Builder objects still in scope");
m_written = m_committed;
}
/**
* Clear the buffer.
*
* No-op on an invalid buffer.
*
* @pre No builder can be open on this buffer.
*
* @returns Number of bytes in the buffer before it was cleared.
*/
std::size_t clear() {
assert(m_builder_count == 0 && "Make sure there are no Builder objects still in scope");
const std::size_t committed = m_committed;
m_written = 0;
m_committed = 0;
return committed;
}
/**
* Get the data in the buffer at the given offset.
*
* @pre The buffer must be valid.
*
* @tparam T Type we want to the data to be interpreted as.
*
* @returns Reference of given type pointing to the data in the
* buffer.
*/
template <typename T>
T& get(const std::size_t offset) const {
assert(m_data && "This must be a valid buffer");
return *reinterpret_cast<T*>(&m_data[offset]);
}
/**
* Reserve space of given size in buffer and return pointer to it.
* This is the only way of adding data to the buffer. You reserve
* the space and then fill it.
*
* Note that you have to eventually call commit() to actually
* commit this data.
*
* If there isn't enough space in the buffer, one of three things
* can happen:
*
* * If you have set a callback with set_full_callback(), it is
* called. After the call returns, you must have either grown
* the buffer or cleared it by calling buffer.clear(). (Usage
* of the full callback is deprecated and this functionality
* will be removed in the future. See the documentation for
* set_full_callback() for alternatives.
* * If no callback is defined and this buffer uses internal
* memory management, the buffers capacity is grown, so that
* the new data will fit.
* * Else the buffer_is_full exception is thrown.
*
* @pre The buffer must be valid.
*
* @param size Number of bytes to reserve.
*
* @returns Pointer to reserved space. Note that this pointer is
* only guaranteed to be valid until the next call to
* reserve_space().
*
* @throws osmium::buffer_is_full if the buffer is full there is
* no callback defined and the buffer isn't auto-growing.
*/
unsigned char* reserve_space(const std::size_t size) {
assert(m_data && "This must be a valid buffer");
// try to flush the buffer empty first.
if (m_written + size > m_capacity && m_full) {
m_full(*this);
}
// if there's still not enough space, then try growing the buffer.
if (m_written + size > m_capacity) {
if (m_memory && (m_auto_grow == auto_grow::yes)) {
// double buffer size until there is enough space
std::size_t new_capacity = m_capacity * 2;
while (m_written + size > new_capacity) {
new_capacity *= 2;
}
grow(new_capacity);
} else {
throw osmium::buffer_is_full{};
}
}
unsigned char* data = &m_data[m_written];
m_written += size;
return data;
}
/**
* Add an item to the buffer. The size of the item is stored inside
* the item, so we know how much memory to copy.
*
* Note that you have to eventually call commit() to actually
* commit this data.
*
* @pre The buffer must be valid.
*
* @tparam T Class of the item to be copied.
*
* @param item Reference to the item to be copied.
*
* @returns Reference to newly copied data in the buffer.
*/
template <typename T>
T& add_item(const T& item) {
assert(m_data && "This must be a valid buffer");
unsigned char* target = reserve_space(item.padded_size());
std::copy_n(reinterpret_cast<const unsigned char*>(&item), item.padded_size(), target);
return *reinterpret_cast<T*>(target);
}
/**
* Add committed contents of the given buffer to this buffer.
*
* @pre The buffer must be valid.
* @pre No builder can be open on this buffer.
*
* Note that you have to eventually call commit() to actually
* commit this data.
*
* @param buffer The source of the copy. Must be valid.
*/
void add_buffer(const Buffer& buffer) {
assert(m_data && "This must be a valid buffer");
assert(buffer && "Buffer parameter must be a valid buffer");
assert(m_builder_count == 0 && "Make sure there are no Builder objects still in scope");
unsigned char* target = reserve_space(buffer.committed());
std::copy_n(buffer.data(), buffer.committed(), target);
}
/**
* Add an item to the buffer. This function is provided so that
* you can use std::back_inserter.
*
* @pre The buffer must be valid.
* @pre No builder can be open on this buffer.
*
* @param item The item to be added.
*/
void push_back(const osmium::memory::Item& item) {
assert(m_data && "This must be a valid buffer");
assert(m_builder_count == 0 && "Make sure there are no Builder objects still in scope");
add_item(item);
commit();
}
/**
* An iterator that can be used to iterate over all items of
* type T in a buffer.
*/
template <typename T>
using t_iterator = osmium::memory::ItemIterator<T>;
/**
* A const iterator that can be used to iterate over all items of
* type T in a buffer.
*/
template <typename T>
using t_const_iterator = osmium::memory::ItemIterator<const T>;
/**
* An iterator that can be used to iterate over all OSMEntity
* objects in a buffer.
*/
using iterator = t_iterator<osmium::OSMEntity>;
/**
* A const iterator that can be used to iterate over all OSMEntity
* objects in a buffer.
*/
using const_iterator = t_const_iterator<osmium::OSMEntity>;
template <typename T>
ItemIteratorRange<T> select() {
return ItemIteratorRange<T>{m_data, m_data + m_committed};
}
template <typename T>
ItemIteratorRange<const T> select() const {
return ItemIteratorRange<const T>{m_data, m_data + m_committed};
}
/**
* Get iterator for iterating over all items of type T in the
* buffer.
*
* @pre The buffer must be valid.
*
* @returns Iterator to first item of type T in the buffer.
*/
template <typename T>
t_iterator<T> begin() {
assert(m_data && "This must be a valid buffer");
return t_iterator<T>(m_data, m_data + m_committed);
}
/**
* Get iterator for iterating over all objects of class OSMEntity
* in the buffer.
*
* @pre The buffer must be valid.
*
* @returns Iterator to first OSMEntity in the buffer.
*/
iterator begin() {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data, m_data + m_committed};
}
/**
* Get iterator for iterating over all items of type T in the
* buffer.
*
* @pre The buffer must be valid.
*
* @returns Iterator to first item of type T after given offset
* in the buffer.
*/
template <typename T>
t_iterator<T> get_iterator(std::size_t offset) {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + offset, m_data + m_committed};
}
/**
* Get iterator for iterating over all objects of class OSMEntity
* in the buffer.
*
* @pre The buffer must be valid.
*
* @returns Iterator to first OSMEntity after given offset in the
* buffer.
*/
iterator get_iterator(std::size_t offset) {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + offset, m_data + m_committed};
}
/**
* Get iterator for iterating over all items of type T in the
* buffer.
*
* @pre The buffer must be valid.
*
* @returns End iterator.
*/
template <typename T>
t_iterator<T> end() {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + m_committed, m_data + m_committed};
}
/**
* Get iterator for iterating over all objects of class OSMEntity
* in the buffer.
*
* @pre The buffer must be valid.
*
* @returns End iterator.
*/
iterator end() {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + m_committed, m_data + m_committed};
}
template <typename T>
t_const_iterator<T> cbegin() const {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data, m_data + m_committed};
}
const_iterator cbegin() const {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data, m_data + m_committed};
}
template <typename T>
t_const_iterator<T> get_iterator(std::size_t offset) const {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + offset, m_data + m_committed};
}
const_iterator get_iterator(std::size_t offset) const {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + offset, m_data + m_committed};
}
template <typename T>
t_const_iterator<T> cend() const {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + m_committed, m_data + m_committed};
}
const_iterator cend() const {
assert(m_data && "This must be a valid buffer");
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return {m_data + m_committed, m_data + m_committed};
}
template <typename T>
t_const_iterator<T> begin() const {
return cbegin<T>();
}
const_iterator begin() const {
return cbegin();
}
template <typename T>
t_const_iterator<T> end() const {
return cend<T>();
}
const_iterator end() const {
return cend();
}
/**
* In a bool context any valid buffer is true.
*/
explicit operator bool() const noexcept {
return m_data != nullptr;
}
void swap(Buffer& other) {
using std::swap;
swap(m_memory, other.m_memory);
swap(m_data, other.m_data);
swap(m_capacity, other.m_capacity);
swap(m_written, other.m_written);
swap(m_committed, other.m_committed);
swap(m_auto_grow, other.m_auto_grow);
swap(m_full, other.m_full);
}
/**
* Purge removed items from the buffer. This is done by moving all
* non-removed items forward in the buffer overwriting removed
* items and then correcting the m_written and m_committed numbers.
*
* Note that calling this function invalidates all iterators on
* this buffer and all offsets in this buffer.
*
* For every non-removed item that moves its position, the function
* 'moving_in_buffer' is called on the given callback object with
* the old and new offsets in the buffer where the object used to
* be and is now, respectively. This call can be used to update any
* indexes.
*
* @pre The buffer must be valid.
*/
template <typename TCallbackClass>
void purge_removed(TCallbackClass* callback) {
assert(m_data && "This must be a valid buffer");
if (begin() == end()) {
return;
}
iterator it_write = begin();
iterator next;
for (iterator it_read = begin(); it_read != end(); it_read = next) {
next = std::next(it_read);
if (!it_read->removed()) {
if (it_read != it_write) {
assert(it_read.data() >= data());
assert(it_write.data() >= data());
const auto old_offset = static_cast<std::size_t>(it_read.data() - data());
const auto new_offset = static_cast<std::size_t>(it_write.data() - data());
callback->moving_in_buffer(old_offset, new_offset);
std::memmove(it_write.data(), it_read.data(), it_read->padded_size());
}
it_write.advance_once();
}
}
assert(it_write.data() >= data());
m_written = static_cast<std::size_t>(it_write.data() - data());
m_committed = m_written;
}
}; // class Buffer
inline void swap(Buffer& lhs, Buffer& rhs) {
lhs.swap(rhs);
}
/**
* Compare two buffers for equality.
*
* Buffers are equal if they are both invalid or if they are both
* valid and have the same data pointer, capacity and committed
* data.
*/
inline bool operator==(const Buffer& lhs, const Buffer& rhs) noexcept {
if (!lhs || !rhs) {
return !lhs && !rhs;
}
return lhs.data() == rhs.data() && lhs.capacity() == rhs.capacity() && lhs.committed() == rhs.committed();
}
inline bool operator!=(const Buffer& lhs, const Buffer& rhs) noexcept {
Squashed 'third_party/libosmium/' changes from ce865381f..d2c1d872b d2c1d872b Release v2.14.0 9c9aedd50 Update embedded catch.hpp to version 1.12.1. f94e70d32 Change comment on namespace closing brace to make clang-tidy happy. ad9f03afc Prefer prefix increment operator. a141b9c0c Update change log. 363fc7a15 Add more XML tests. 303a3090f Refactor XML tests. a1ee5dd56 Make util namespace inline. 6f1709a83 Cleanup progress bar code. 1b02b65e0 Use Location setters taking a string in osmium_tiles example. 7ffdc7618 Disable clang-tidy warning. 882631085 Better implementation of str_to_int. 4cbf53725 Fix another bitwise op on signed integer. 903bfac9d Disable clang-tidy warning. 01de3f518 Don't change location if set_lon() or set_lat() functions throw. 9a27e899d Fix bitwise operation on signed integer. 61650224f Disable some clang-tidy warnings. 9dfa8437e Provide a way to better mock the getenv function in tests. ae2c172a2 Explicitly set integer type for integers in test code. 878850068 Simpler implementation. We don't need to look at errno at all. 8f9b886f5 Formatting cf4760cb0 Use bit operations on unsigned where possible. c7cb4cde8 No conversion needed later if we declare it this way. 01357a540 Add missing inline for free function. 3feef81ee Disable clang-tidy warning in place we can't do anything about. bf083b8ee Avoid binary bitwise operations on signed integers. f70b1c803 Move content of osmium::util::detail namespace into osmium::detail. caf2f0033 Remove use of atoi and atol from code. f564cef07 Formatting. f0885fc73 Disable travis build with sanitizers. 858c58444 Use explicit asserts and then casts, not static_cast_with_assert. a613b1b0a Disable clang-tidy warning. 50e327677 Always build and run data tests on travis. 20d7a09b0 Update submodule to add more XML tests. 6c8f652bf Merge pull request #250 from Nakaner/object-comparison-without-timestamp 38ea437c0 Make XML parser more strict. 7788f5108 Remove object_order_type_id_reverse_version_without_timestamp fe2223d25 Ignore timestamps if only one object has a valid timestamp a4515161a Code cleanup. eb5ea1a0e Use explicit conversions. 105905c45 Only disable warning on non-MSVC compilers. 80fc1b35d Change the way IDs are parsed from strings. 78aedf91e More tests for StringMatcher and disable a clang-tidy warning. 644a00752 Move catch.hpp into its own directory. 19842756c Update to newest osm-testdata submodule. 0402f64d7 Fix the problem with "git submodule" in appveyor. ec4095d32 Cleanup metadata_options code. d7390741e Add static_cast to avoid conversion warning. dd16be1c3 Remove else after throw. ef4d618de Remove unused variable. 0fdb58d13 Check out submodule in appveyor builds. 6406282d3 Merge pull request #248 from Nakaner/metadata-options-more eb138a902 make clang < 3.9 work e703b0d1d make sections their own independent test cases f68888006 detect_available_metadata must be inline b53224588 move metadata_options into osmium namespace edd363cfa make const what could be const 302a485e5 remove unnecessary include, add missing include 93a76e07e give osmium::io::metadata_from_object a better name 91dfbc427 update documentation 453cd6395 replace REQUIRE(!foo) by REQUIRE_FALSE(foo) 247c3b021 replace friend function by setter methods 0a62e589c performance improvement: check first character instead using std::strlen() 73568bbff move ctor of metadata_options which taks an OSMObject out of class 1879c9e47 restore metadata_options::to_string 71a303608 add more unit tests for osmium::io::metadata_options 843cdc89c replace osmium::io::metdata_options::to_string fully by operator<< 6402a8793 Fix bug in code which determines if an OSM object has a valid user. a6d8143ae Move metadata_options out of "detail" subnamespace 61e32df10 add metadata_options::operator|= d5f7cc0ab Use newest osm-testdata submodule. 31e34f10c add operator&=, operator<< and a to_string method to metadata_options 77d507172 Formatting fixes. 1c38b2a61 Update some URLs. Use https where possible. 10066cb3e Merge pull request #247 from Nakaner/issue-245 3c938ce82 Allow version=-1 and changeset=-1 for PBF input. 9a542c133 Add ReaderWithProgressBar class. 49839a1ce Replace strftime by our own implementation. b32b90942 Update osm-testdata version used. f88b6e548 Add more tests. cb7e778f6 Handle NULL geometries in test cases. 1961a9c95 Clean up some test cases. d7f45e071 Update osm-testdata submodule. 73a2ef18f Remove check for lost ways in multipolygon assembler. 1244e498a Update submodule also in msys2 build. 229fc2453 Revert "Make util namespace inline." 9f942d2e9 Revert "Add inline declaration to one util namespace we forgot." 40d4835ea Really fix appveyor build (I hope). 5ae071135 Add inline declaration to one util namespace we forgot. e0916257c Clean up debug message. 2ddc474cc Make util namespace inline. 4b4e25f87 Travis config: Do not install clang-tidy, we are not using it. 5a608fba1 Fix travis build. a075cc323 Fix appveyor build. 41ee9920b Add submodule with osm-testdata repository. 4d42245c0 Revert "Add clang-tidy build to travis." 9df355b64 Fix issue on some compilers. c8a3c00d6 Add clang-tidy build to travis. 2fc80ad17 Fixed clang-tidy config file order. 2adf05267 Fix various clang-tidy warnings 1dca92459 Use the right syntax to override clang-tidy settings in the code. 25baecb46 Fix some issues found by clang-tidy. 54a8de6c0 Disable more clang-tidy tests. de46d562e Also look for clang-tidy-6.0 in CMake config. 2172553d8 Add build with sanitizers on travis. 7e4e45562 Add object comparators ignoring the timestamp. 92fb231a1 Fix test code. e541df0fc Cleanup test code. 5640269da Add comment in appveyor script about unusual parameter. acb872376 Workaround for failing appveyor MSYS2 build. 0634bcf70 Set default value for m_file_size member. 3a2fe5781 Set default values on output options. 43d289fda Make metadata_options constructor explicit. 6e54992b4 Update change log. e54b955cf Update included `catch.hpp` to version 1.12.0. e50b40d53 Update copyright date. 0d8b401b6 Merge branch 'metadata' c7da3a3b6 Remove superfluous has_visibles boolean. 7f74d33d3 Some cleanups of metadata code and fixes test. 5b3c34990 Output XML attributes uid and user independently of each other. 384167334 Merge pull request #243 from Nakaner/metadata_other 733f1916c Change path of nuget installs in appveyor config. e48672999 Debug output from FindOsmium.cmake script is better formatted now. 79663be5d Change appveyor scripts to work without deprecated prebuilt libs. 443f7a9e4 Remove dependency on (win)getopt completely. c133b8b14 Fix osmium_convert: Long options with = syntax. b55daf00a Remove dependency on (win)getopt from area_test and convert examples. 92f7275a9 output visibility directly after the object ID in debug format a771279f0 deprecate format option pbf_add_metadata 18e3f6005 The value "no" should be treated as "none" by metadata_options c8b0b2e28 re-assign metadata_options instead of calling a public method of it 15bc4a200 Add more flexible metadata handling to PBF output b085632b7 add more flexible metadata handling to OPL and debug output a12c65974 Remove now wrong check. 767ad883a Allow PBF DenseNodes with only some attributes to be read. fd5a7eb6c More flexible metadata encoding in OSM files. d16c18581 Add instructions for bug reporting. db52591ab Use __COUNTER__ instead of name for internal dummy name. 89e634dfc Cleanup. 931ec30ca Marks some false positives for clang-tidy google-runtime-int warning. b59ef02a2 More rule of zero/rule of five fixes. 1b72b3386 Pass by value and use std::move. b7d7017cc Handle some clang-tidy google-runtime-int warnings. c043ca016 Fix special functions. 41d9f0795 Use fixed sized ints where possible. 0899a66a7 Revert some changes older compilers don't like. 41e05989a Fix several rule of zero/rule of five issues. 4e78a828f Various fixes based on clang-tidy reports. 636bda372 Default initialize arrays. 466e5aa6a Handle various clang-tidy warnings. 9f47aa07d Disable clang-tidy misc-forwarding-reference-overload warning. 5e97bf29f Mark Reader and Writer non-movable. 3a2221b27 Add minimal tests for thread-safe queue class. affdeed6f Add some tests. 5ed055d50 Handle some warnings regarding "explicit". b9d4c9bf5 Disable clang-tidy cert-err58-cpp warning. 254c25349 Make ADL work for begin()/end() of InputIterator<Reader>. b64cb32ae Disable clang-tidy android-cloexec-* warnings. 6d6934ffc Fix various warnings reported by clang-tidy. 30dcabaed Another travis build fix. 88c59e669 Fix travis build. 2facb461f Fix travis and appveyor builds. bba631a51 Remove protozero from repository. aebe4a914 Use pass by value and std::move in some constructors. c8c24c8fd Name unused parameters in comments. 9c2e321f9 Make deleted special functions public. 265c16284 Fix some problems with older compilers. 174e95211 Modernize class initialization code for some classes. 4e3e584f8 Disable more clang-tidy warnings. 6b53981bb Fix some class initializations. fe1405ef8 Add/remove special functions for some classes. c6dd930d9 Disable cppcoreguidelines-pro-type-static-cast-downcast warning. 0d09210ec Disable misc-unused-parameters warning in clang-tidy. 1dbc43112 Refactor to avoid misc-suspicious-string-compare clang-tidy warning. 91262cc86 Merge pull request #232 from worace/wkt-geojson-polygons 438076b09 Cleanup: Avoid else after return/break. e0368e92c Disable modernize-raw-string-literal and hicpp-no-assembler check. c822888fc Mark C style cast in macro from a library as NOLINT. 662d4a641 Moving a TypedMemoryMapping is noexcept. aec1c4526 Use auto (clang-tidy check modernize-use-auto). 64857589d Consistent include order. d1ce8de00 Disable hicpp-invalid-access-moved clang-tidy check. 0d3902420 Refactor test without SECTION. 32e9e9e1e Rewrite test avoiding nested sections. eeb532902 Reorder includes according to best practice. 249e7b553 Revert "Add build with sanitizers to travis." 362cb419a Set CC env var in travis config. 9f520eca3 Add build with sanitizers to travis. cfc18fef0 Travis config cleanup. 212c6cd42 Remove tests that triggers undefined behaviour in the std lib. f30985884 Bugfix: Avoid undefined behaviour. 90191619a Make test work even if unused memory isn't returned to OS. 876867e68 Make older compilers happy. 925d1a797 Add names for unused parameters. 014b3a056 Avoid repeating the return type from the declaration c4e705f92 Disable hicpp-invalid-access-moved clang-tidy warnings. 8c03b3827 Disable some warnings. c49962ffe Refactor test to avoid spurious use-after-move warning. 04a0afbba Sort includes. 2aaab9a89 Use auto where possible. e2d84109b More changes for old compilers. 5364ca2a8 Changes for old compilers. 098fc1fa2 Move initializations of class members to the declaration. eea463026 Fix buffer overflow in o5m parser. 5dc74f2d5 Remove check from static cast (and document why). 7a2dfdcdc Add NOLINT for using namespace osmium::builder::attr. 01fa05f1e Clang-tidy config cleanup. 5e8f8df3f Order includes. 6b78d9b24 Various small fixes for problems detected by clang-tidy. b815f71b7 Fix gdal check in CMake config. d47487093 Fix integer type error. dec9de9ec Bugfix: Throw if elemens in XML file are nested too deep. 85e37723b Various small cleanups. 5f40d726a Additional checks in o5m parser. b59b4b6a6 Check before static cast and throw. e57b15700 Disable compiling some header files if gdal lib is not available. 1d3056646 Better checking that PBF data is in range. c586521d3 Add some consts to the code. df17e8189 Trying to get the types right... 8e9b759e0 Check read and write system call for EINTR. 28c676054 Rename license file so that Github finds it. be29e9a52 Remove duplicate space character. 36c14136f Update protozero to newest version (1.6.0). a19181998 Make libosmium work with different protozero versions. 5c5d9fb36 Use tag and type from protozero to make PBF parser more robust. 03f894400 Add repology.org badge to README.md. 1840739dd Merge pull request #234 from AMDmi3/patch-1 d8e737196 Add support for DragonFly BSD 8de181c8d Revert "Return const object from postfix ++ operator." 0dfb1d649 Add polygon implementation for WKT and GeoJSON Geometry Factories 150e05aea Fix indentation. 6fdee974a Merge pull request #229 from alex85k/no-winsock f302f08ce Merge pull request #228 from alex85k/fix-test-win bfb60c888 remove ws2_32 from needed libraries ef187851c no winsock2 on windows: replace htonl with protozero::detail::byteswap_inplace 9343f8453 Fix testdata-multipolygon test on Windows (executable path differs) 381cf9272 Do not return const from postfix increment operator. 46ec985e9 Add const version of OutputIterator::operator*. c67de374f Disable clang-tidy test for const params. f5eda165f Make functions noexcept and return const value from post increment op. 1e4e3160f Use {} when calling constructors. Use .empty() to check empty strings. 8893d16be Mark some tests using size() with NOLINT. f8a74a8aa Make functions noexcept. 45c1e072c Use REQUIRE_FALSE(...) instead of REQUIRE(!...) for readability. fc173dae7 Merge pull request #227 from alex85k/msys2-appveor 0a281c064 Add MSYS2 building to Appveyor c93f73120 fix FindGem for Windows Ruby distributions 8bf6702b3 Merge pull request #226 from alex85k/master e8dad731d gmtime_s should be used on both MSVC and GCC from MinGW64 d0d98e9c1 remove "osmium::util::MemoryMapping::" from class body 6830ee9bd ftruncate is not available only on MSVC (MinGW has it) c0597584f Disable some clang-tidy checks. 578db8e4a Use empty() instead of size() or == "" to check for empty collections. 53c8f3a21 Return const object from postfix ++ operator. bd5e4d109 Use emplace_back() instead of push_back(). 0a0a4f24c Use correct C++ header. 35226ea86 Remove unused move. df843a9cf Fix header guard. 759e76131 Avoid default argument on virtual function. db4f1bdb9 Update included catch.hpp to version 1.10.0. 59e70e5c6 Pass constructor arguments by value and std::move() into members. ee9b598ed Add tests for thread_handler. ac661209a CMake config: Update list of clang-tidy versions we look for. d7281215c Add comment to unusual code. cbb4c09fb Split up some overlong test functions. 9870a6b90 Fix noexcept specification. 5e27c37d0 Use array instead of map to store input/output format creators. 987d12922 Mark some constructors noexcept. 17f4d8b7e Avoid static variable only needed as constant value. fe705cef0 Avoid else after return in several cases. d4a85878e Beautifying travis config. f07d1e375 Make some special functions noexcept. 4bb0f7f22 Do not declare special functions on some classes. bc6c5943d Disable some clang-tidy checks that produce false positives. 6b6598a5b Remove superfluous std::move() of POD type. 71c3f5e16 Make some special functions noexcept. 1cb32778c Remove explicit true/false in tests. 929ba89cf Always catch by const ref. a9a255820 Code readability: No else clause after return. f14364bd3 Code formatting fixes. f41feb6a5 Simplify code. 727f6eff4 Mark dummy includes for IWYU. 72d20f835 Switch travis build to 'trusty'. c480e6808 Do not run gcov from codecov script. d16c6e90a Clean up lambda captures in xml_input_format.hpp. git-subtree-dir: third_party/libosmium git-subtree-split: d2c1d872bc915d9579350007383ce1ebfea3665f
2018-04-19 15:03:25 -04:00
return !(lhs == rhs);
}
} // namespace memory
} // namespace osmium
#endif // OSMIUM_MEMORY_BUFFER_HPP