libi2ncommon
5 years agoRealized that SouceLocation and ScopeTracker can never be no-throw scopetracker-nothrow
Christian Herdtweck [Tue, 4 Sep 2018 09:29:07 +0000]
Realized that SouceLocation and ScopeTracker can never be no-throw

Constructors can always throw if the class has non-pointer attributes
(at least I think so). So would have to re-design SourceLocation and
ScopeTracker to only contain pointers in order to make SCOPETRACKER
guaranteed no-throw.

5 years agoWrap Scopetracker constructor/destructor in big try-catch
Christian Herdtweck [Mon, 6 Aug 2018 10:43:33 +0000]
Wrap Scopetracker constructor/destructor in big try-catch

5 years agoReturn NULL thread local storage instead of raising exception
Christian Herdtweck [Mon, 6 Aug 2018 10:43:07 +0000]
Return NULL thread local storage instead of raising exception

5 years agoClarify what SourceLocation functions can throw
Christian Herdtweck [Mon, 6 Aug 2018 10:39:49 +0000]
Clarify what SourceLocation functions can throw

5 years agoMerge branch 'stringfunc-join_string'
Thomas Jarosch [Thu, 2 Aug 2018 13:39:44 +0000]
Merge branch 'stringfunc-join_string'

5 years agorestore join_string() symbols in library
Philipp Gesang [Thu, 19 Jul 2018 14:01:30 +0000]
restore join_string() symbols in library

To keep the library it backward compatible, instantiate versions
of join_string() for STL containers.

Old symbols (x86):

    0003a040 g    DF .text  00000083  Base        _ZN3I2n11join_stringERKSt4listISsSaISsEERKSs
    00039fb0 g    DF .text  00000084  Base        _ZN3I2n11join_stringERKSt6vectorISsSaISsEERKSs

New symbols:

    000aa0fd g    DF .text  00000041  Base        _ZN3I2n11join_stringERKSt4listISsSaISsEERKSs
    000b084d  w   DF .text  0000017d  Base        _ZN3I2n11join_stringISt20_List_const_iteratorISsEEESsT_S3_RKSs
    000b09ca  w   DF .text  0000017d  Base        _ZN3I2n11join_stringIN9__gnu_cxx17__normal_iteratorIPKSsSt6vectorISsSaISsEEEEEESsT_S9_RS3_
    000aa13e g    DF .text  00000041  Base        _ZN3I2n11join_stringERKSt6vectorISsSaISsEERKSs
    000afbce  w   DF .text  00000074  Base        _ZN3I2n11join_stringISt6vectorISsSaISsEEEESsRKT_RKSs
    000a9f62 g    DF .text  0000019b  Base        _ZN3I2n11join_stringEPKPKcRKSs
    000afb5a  w   DF .text  00000074  Base        _ZN3I2n11join_stringISt4listISsSaISsEEEESsRKT_RKSs

5 years agoadd unit tests for join_string() overloads
Philipp Gesang [Thu, 19 Jul 2018 13:32:51 +0000]
add unit tests for join_string() overloads

5 years agoimplement iterator based join_string()
Philipp Gesang [Thu, 19 Jul 2018 10:54:06 +0000]
implement iterator based join_string()

For more idiomatic C++, add a version of join_string () that
accepts a pair of iterators and templatize it, to supersede the
existing boilerplate variants. Good riddance.

5 years agooverload join_string() for std::set
Philipp Gesang [Thu, 19 Jul 2018 09:02:53 +0000]
overload join_string() for std::set

5 years agoadd char** overloads for join_string
Philipp Gesang [Fri, 9 Feb 2018 13:19:36 +0000]
add char** overloads for join_string

Add overloads to joing NULL-terminated arrays with
join_string().

6 years agochange permissions before fsync()
Philipp Gesang [Tue, 24 Apr 2018 11:23:12 +0000]
change permissions before fsync()

Reorder the calls so that the metadata changes performed by
fchmod() are committed to disk (journal) the same way as the
data.

6 years agoAdapt Requires.private and Libs.private to make pkg-config output all neccessary...
Gerd von Egidy [Tue, 27 Jun 2017 15:06:27 +0000]
Adapt Requires.private and Libs.private to make pkg-config output all neccessary libs for a static build

6 years agobuild static library versions of libi2ncommon too
Gerd von Egidy [Tue, 27 Jun 2017 11:00:53 +0000]
build static library versions of libi2ncommon too

6 years agoBOOST_MESSAGE got replaced by BOOST_TEST_MESSAGE in newer versions of boost
Gerd von Egidy [Tue, 27 Jun 2017 09:05:00 +0000]
BOOST_MESSAGE got replaced by BOOST_TEST_MESSAGE in newer versions of boost

6 years agobase64 encoder/decoder: Add parameter to control linefeed handling
Thomas Jarosch [Thu, 8 Jun 2017 09:22:14 +0000]
base64 encoder/decoder: Add parameter to control linefeed handling

openssl is very strict about if the input data of the decoder
contains linefeeds or not.

Therefore make it a parameter and default
to "one line" base64 output/input.

Add unit test cases.

6 years agoAdd new base64_encode() / base64_decode() functions
Thomas Jarosch [Fri, 19 May 2017 13:31:23 +0000]
Add new base64_encode() / base64_decode() functions

Based upon openssl. If an error occurs, an exception
is thrown and memory cleanup is still done.

7 years agoIncrease version to 2.9 v2.9
Thomas Jarosch [Thu, 23 Mar 2017 11:25:13 +0000]
Increase version to 2.9

Carefully checked that it should be ABI compatible to 2.8.

7 years agoDeclare internal function rounding_upwards() to have local linkage only
Thomas Jarosch [Thu, 23 Mar 2017 10:42:35 +0000]
Declare internal function rounding_upwards() to have local linkage only

7 years agoRename get_dir_size() to get_dir_count()
Thomas Jarosch [Thu, 23 Mar 2017 10:37:35 +0000]
Rename get_dir_size() to get_dir_count()

7 years agoCreate unittest for i18n_noop[s]
Christian Herdtweck [Wed, 15 Feb 2017 14:41:07 +0000]
Create unittest for i18n_noop[s]

7 years agoAdd another convenience function allowing i18n_noops("foo")+"bar"
Christian Herdtweck [Wed, 15 Feb 2017 14:40:50 +0000]
Add another convenience function allowing i18n_noops("foo")+"bar"

7 years agoMerge branch 'scopetracker-shorter-types'
Thomas Jarosch [Thu, 23 Mar 2017 09:23:01 +0000]
Merge branch 'scopetracker-shorter-types'

7 years agoRun shorten_stl_types (and a bit more) only if needed in scope tracker
Christian Herdtweck [Wed, 25 Jan 2017 08:39:48 +0000]
Run shorten_stl_types (and a bit more) only if needed in scope tracker

7 years agoUse new shorten_stl_types in scope tracker
Christian Herdtweck [Tue, 24 Jan 2017 09:54:42 +0000]
Use new shorten_stl_types in scope tracker

7 years agoCreate unit tests for new shorten_stl_types
Christian Herdtweck [Tue, 24 Jan 2017 09:54:17 +0000]
Create unit tests for new shorten_stl_types

7 years agoCreate string-function shorten_stl_types
Christian Herdtweck [Tue, 24 Jan 2017 09:54:08 +0000]
Create string-function shorten_stl_types

7 years agoCreate get_dir_size to avoid unnecessary name copying if only size needed
Christian Herdtweck [Thu, 16 Mar 2017 13:13:24 +0000]
Create get_dir_size to avoid unnecessary name copying if only size needed

7 years agoMerge branch 'remove-html-comments'
Thomas Jarosch [Wed, 22 Mar 2017 10:11:44 +0000]
Merge branch 'remove-html-comments'

7 years agoChange find_html_comments() API to return the results
Thomas Jarosch [Wed, 22 Mar 2017 10:10:47 +0000]
Change find_html_comments() API to return the results

7 years agoCreate vector-result-version of split_string with unit test
Christian Herdtweck [Fri, 17 Feb 2017 17:09:40 +0000]
Create vector-result-version of split_string with unit test

[Note from Tom during review:
 Can still be optimized later on when the API is in place]

7 years agoAdd unittests for new find/replace_html_comments
Christian Herdtweck [Wed, 8 Feb 2017 15:22:51 +0000]
Add unittests for new find/replace_html_comments

7 years agoCreate functions find/remove_html_comments
Christian Herdtweck [Wed, 8 Feb 2017 15:22:34 +0000]
Create functions find/remove_html_comments

Similar functions existed in two places in UI but these were not able to
deal with nested comments.

7 years agoAdded function format_date which is format_full_time without time
Christian Herdtweck [Thu, 15 Dec 2016 12:38:13 +0000]
Added function format_date which is format_full_time without time

7 years agoClean up log file created in unit tests
Christian Herdtweck [Wed, 25 Jan 2017 08:58:19 +0000]
Clean up log file created in unit tests

7 years agoEnsure filefunc unit test works with all working dirs
Christian Herdtweck [Wed, 25 Jan 2017 08:58:08 +0000]
Ensure filefunc unit test works with all working dirs

The __FILE__ macro contains an absolute path.

7 years agoFix comment
Christian Herdtweck [Wed, 8 Feb 2017 12:22:09 +0000]
Fix comment

7 years agoAdd convenience functions for i18n_get_string + unit tests
Christian Herdtweck [Wed, 4 Jan 2017 08:37:50 +0000]
Add convenience functions for i18n_get_string + unit tests

7 years agoCorrect file header docu
Christian Herdtweck [Thu, 8 Dec 2016 09:27:20 +0000]
Correct file header docu

7 years agoAdd comment about error-checking to docu of string_to<T>
Christian Herdtweck [Fri, 2 Dec 2016 13:47:54 +0000]
Add comment about error-checking to docu of string_to<T>

7 years agoAdd comments for mkstemp in filefunc so I do not try to re-create tmpfstream again
Christian Herdtweck [Tue, 15 Nov 2016 12:17:13 +0000]
Add comments for mkstemp in filefunc so I do not try to re-create tmpfstream again

7 years agoAdd overload of join_string for vector argument + unittest
Christian Herdtweck [Tue, 8 Nov 2016 09:02:56 +0000]
Add overload of join_string for vector argument + unittest

7 years agoFix unittests
Christian Herdtweck [Tue, 8 Nov 2016 09:02:06 +0000]
Fix unittests

7 years agoadd functions to convert from hex strings to other types
Gerd von Egidy [Mon, 18 Jul 2016 12:11:43 +0000]
add functions to convert from hex strings to other types

7 years agoincreased revision --> now version 2.8 rev 2
Christian Herdtweck [Tue, 12 Jul 2016 09:00:38 +0000]
increased revision --> now version 2.8 rev 2

7 years agoupdate i18n-ed string for "day"/"days" since it clashed with UI
Christian Herdtweck [Tue, 12 Jul 2016 08:46:41 +0000]
update i18n-ed string for "day"/"days" since it clashed with UI

7 years agoextended unittest to double-version of nice_unit_format
Christian Herdtweck [Wed, 1 Jun 2016 08:00:42 +0000]
extended unittest to double-version of nice_unit_format

7 years agoadded function nice_unit_format for double input (calls other after proper round...
Christian Herdtweck [Wed, 1 Jun 2016 08:00:27 +0000]
added function nice_unit_format for double input (calls other after proper round&cast)

7 years agomade arg const that is not modified
Christian Herdtweck [Wed, 1 Jun 2016 07:42:02 +0000]
made arg const that is not modified

8 years agoSwitch to Intra2net rpm group
Thomas Jarosch [Wed, 23 Dec 2015 18:13:26 +0000]
Switch to Intra2net rpm group

8 years agoimplement counting hardlinked files only once in du()
Gerd von Egidy [Thu, 17 Dec 2015 22:01:03 +0000]
implement counting hardlinked files only once in du()

8 years agofix missing include files and inline definition
Gerd von Egidy [Thu, 17 Dec 2015 15:28:17 +0000]
fix missing include files and inline definition

8 years agomake unittest compatible with old versions of du that don't offer the --output option
Gerd von Egidy [Thu, 17 Dec 2015 10:53:00 +0000]
make unittest compatible with old versions of du that don't offer the --output option

8 years agoincrease version to 2.8, soversion to 6 since we changed the interface v2.8
Gerd von Egidy [Thu, 17 Dec 2015 10:22:47 +0000]
increase version to 2.8, soversion to 6 since we changed the interface

8 years agoretry df test up to 5 times if it fails due to some other program writing/deleting...
Gerd von Egidy [Thu, 17 Dec 2015 10:19:52 +0000]
retry df test up to 5 times if it fails due to some other program writing/deleting in /tmp

8 years agoAlways initialize exit_set
Thomas Jarosch [Thu, 17 Dec 2015 10:01:38 +0000]
Always initialize exit_set

Be on the safe side.

8 years agorename pipe_to_string() to capture_exec() and improve it's interface
Gerd von Egidy [Thu, 17 Dec 2015 09:56:27 +0000]
rename pipe_to_string() to capture_exec() and improve it's interface

8 years agocheck if status_set != NULL before setting it
Gerd von Egidy [Thu, 17 Dec 2015 09:27:38 +0000]
check if status_set != NULL before setting it

8 years agosplit pipestream.hxx into .hxx and .cpp
Gerd von Egidy [Thu, 17 Dec 2015 09:26:07 +0000]
split pipestream.hxx into .hxx and .cpp

8 years agoFix typo in comment
Thomas Jarosch [Thu, 17 Dec 2015 08:26:09 +0000]
Fix typo in comment

8 years agoimplement pipe_to_string() and use it to shorten the test case sourcecode
Gerd von Egidy [Wed, 16 Dec 2015 23:57:29 +0000]
implement pipe_to_string() and use it to shorten the test case sourcecode

8 years agoimplement du()
Gerd von Egidy [Wed, 16 Dec 2015 23:32:07 +0000]
implement du()

8 years agoalso replace opendir() by our get_dir(), you get eye cancer when looking at the c...
Gerd von Egidy [Wed, 16 Dec 2015 23:04:39 +0000]
also replace opendir() by our get_dir(), you get eye cancer when looking at the c functions

8 years agofix symlink-dir-bug by switching from stat() to our Stat-class and using it's follow_...
Gerd von Egidy [Wed, 16 Dec 2015 22:59:32 +0000]
fix symlink-dir-bug by switching from stat() to our Stat-class and using it's follow_links=false

8 years agosanitize indent so that I can work with this code
Gerd von Egidy [Wed, 16 Dec 2015 22:36:50 +0000]
sanitize indent so that I can work with this code

8 years agotest handling of symlinks to directories in recursive_delete: seems to be buggy
Gerd von Egidy [Wed, 16 Dec 2015 15:37:55 +0000]
test handling of symlinks to directories in recursive_delete: seems to be buggy

8 years agoadd safeguard against infinite loop with EINTR, even if that case is very unlikely
Gerd von Egidy [Wed, 16 Dec 2015 14:33:09 +0000]
add safeguard against infinite loop with EINTR, even if that case is very unlikely

8 years agoadd Stat::BytesOnDisk()
Gerd von Egidy [Wed, 16 Dec 2015 14:19:55 +0000]
add Stat::BytesOnDisk()

8 years agofix typo
Gerd von Egidy [Wed, 16 Dec 2015 13:38:50 +0000]
fix typo

8 years agoadd get_free_diskspace()
Gerd von Egidy [Wed, 16 Dec 2015 13:37:17 +0000]
add get_free_diskspace()

8 years agofix code style
Gerd von Egidy [Wed, 16 Dec 2015 12:56:23 +0000]
fix code style

8 years agominor speed optimization
Gerd von Egidy [Wed, 16 Dec 2015 10:55:30 +0000]
minor speed optimization

8 years agoautomatically sanitize all messages logged through I2n::Logger, provide an option...
Gerd von Egidy [Wed, 16 Dec 2015 10:43:41 +0000]
automatically sanitize all messages logged through I2n::Logger, provide an option to disable this

8 years agoadd sanitize_for_logging() to stringfunc
Gerd von Egidy [Wed, 16 Dec 2015 09:57:43 +0000]
add sanitize_for_logging() to stringfunc

8 years agoadd attention about the string_to interface usage
Gerd von Egidy [Wed, 16 Dec 2015 09:13:53 +0000]
add attention about the string_to interface usage

8 years agoAdd new option to recursive_delete: keep_parent_dir
Thomas Jarosch [Tue, 15 Dec 2015 10:06:24 +0000]
Add new option to recursive_delete: keep_parent_dir

Also added unit tests for the new feature.

8 years agoadded comments to pipestream, including WEXITSTATUS
Christian Herdtweck [Mon, 30 Nov 2015 08:27:38 +0000]
added comments to pipestream, including WEXITSTATUS

8 years agoStart .gitignore
Thomas Jarosch [Wed, 11 Nov 2015 17:51:11 +0000]
Start .gitignore

8 years agoNew function to check if two files differ: file_content_differs()
Thomas Jarosch [Wed, 11 Nov 2015 17:47:19 +0000]
New function to check if two files differ: file_content_differs()

8 years agoProperly initialize FollowLinks in the default constructor
Thomas Jarosch [Mon, 22 Jun 2015 19:24:09 +0000]
Properly initialize FollowLinks in the default constructor

Detected by cppcheck.

8 years agoadd test to make sure tmpofstream handles file creation errors gracefully
Gerd von Egidy [Tue, 12 May 2015 08:20:16 +0000]
add test to make sure tmpofstream handles file creation errors gracefully

8 years agoRelease libi2ncommon 2.7 v2.7
Thomas Jarosch [Mon, 11 May 2015 08:08:52 +0000]
Release libi2ncommon 2.7

8 years agomake pid_of work with processes owned by other users, same method used as in 'ps'
Gerd von Egidy [Sun, 10 May 2015 14:56:29 +0000]
make pid_of work with processes owned by other users, same method used as in 'ps'

8 years agowhen running the unit test without root, you don't have write access to /var/run
Gerd von Egidy [Sun, 10 May 2015 14:30:48 +0000]
when running the unit test without root, you don't have write access to /var/run

8 years agoMove includedir to /usr/include/libi2ncommon
Thomas Jarosch [Tue, 5 May 2015 08:04:43 +0000]
Move includedir to /usr/include/libi2ncommon

Some of our header filenames are very generic,
so let's group them in an own subdirectory.

9 years agomake licensing more transparent
Gerd von Egidy [Wed, 8 Apr 2015 12:53:45 +0000]
make licensing more transparent

9 years agorelease libi2ncommon 2.6 v2.6
Gerd von Egidy [Wed, 8 Apr 2015 09:06:18 +0000]
release libi2ncommon 2.6

9 years agonew directories - increase the soversion to really make sure we don't miss to update...
Gerd von Egidy [Wed, 8 Apr 2015 08:51:31 +0000]
new directories - increase the soversion to really make sure we don't miss to update any dependent program

9 years agofix & improve packaging
Gerd von Egidy [Wed, 8 Apr 2015 08:44:38 +0000]
fix & improve packaging

9 years agolibi2ncommon is no Intranator-specific lib anymore, it is open source. So don't insta...
Gerd von Egidy [Wed, 8 Apr 2015 08:07:54 +0000]
libi2ncommon is no Intranator-specific lib anymore, it is open source. So don't install it into /usr/intranator anymore

9 years agowrite libs into lib64 dir on 64 bit platforms
Gerd von Egidy [Wed, 8 Apr 2015 07:58:29 +0000]
write libs into lib64 dir on 64 bit platforms

9 years agoboost::shared_dynamic_cast is deprecated and removed in recent versions of boost...
Gerd von Egidy [Thu, 2 Apr 2015 15:28:27 +0000]
boost::shared_dynamic_cast is deprecated and removed in recent versions of boost, replace it with dynamic_pointer_cast

9 years agoadd function html_entities_to_console to stringfunc
Gerd von Egidy [Thu, 5 Feb 2015 14:34:12 +0000]
add function html_entities_to_console to stringfunc

9 years agomoved function remove_unlisted_files from intranator/generate to libi2ncommon because...
Christian Herdtweck [Tue, 25 Nov 2014 12:44:42 +0000]
moved function remove_unlisted_files from intranator/generate to libi2ncommon because is needed in other places, also

9 years agochanged doc only to make doxygen happier and get less warnings during build
Christian Herdtweck [Tue, 25 Nov 2014 12:43:39 +0000]
changed doc only to make doxygen happier and get less warnings during build

9 years agofixed problem with absolute path for boost iostreams lib in pkg-config file
Christian Herdtweck [Tue, 18 Nov 2014 09:03:43 +0000]
fixed problem with absolute path for boost iostreams lib in pkg-config file

9 years agoadded function get_log_level_string to logfunc.cpp/hpp
Christian Herdtweck [Wed, 5 Nov 2014 16:26:34 +0000]
added function get_log_level_string to logfunc.cpp/hpp

10 years agoIncrease version
Thomas Jarosch [Mon, 18 Nov 2013 14:48:12 +0000]
Increase version

10 years agoadd new trunc option to write_file
Gerd von Egidy [Tue, 20 Aug 2013 13:55:48 +0000]
add new trunc option to write_file

10 years agoAdd ugly cast for our siginfo_t forward declaration.
Thomas Jarosch [Mon, 17 Jun 2013 15:03:05 +0000]
Add ugly cast for our siginfo_t forward declaration.

gcc complained:
/root/rpmbuild/BUILD/libi2ncommon-2.4/utils/signalfunc.cpp: In function ‘bool I2n::SystemTools::install_signal_handler(I2n::SystemTools::Signal, void (*)(int, siginfo*, void*))’:
/root/rpmbuild/BUILD/libi2ncommon-2.4/utils/signalfunc.cpp:370: error: invalid static_cast from type ‘void (*)(int, siginfo*, void*)’ to type ‘void (*)(int, siginfo_t*, void*)’

We can get away with casting function pointer types on x86:
http://stackoverflow.com/questions/559581/casting-a-function-pointer-to-another-type

Not sure if it's really worth to avoid including signal.h from signalfunc.hpp...

10 years agoFix pkgconfig library dependency on boost iostreams library (newer binutils needs -l)
Thomas Jarosch [Mon, 17 Jun 2013 13:34:01 +0000]
Fix pkgconfig library dependency on boost iostreams library (newer binutils needs -l)