13
0
Commit Graph

57 Commits

Author SHA1 Message Date
1abe8f4e42 Add PBD::tmp_writable_directory utility function to pbd/file_utils.h/cc 2014-12-03 17:31:04 +07:00
6fbd0a62e4 recursive file copy function 2014-09-28 18:24:08 +02:00
66684c6690 Add PBD::get_suffix() for ripping file suffixes from paths 2014-07-08 12:24:56 -04:00
dcca72dabd Use 'GStatBuf' in preference to 'struct stat' (which isn't necessarily the same thing) 2014-06-28 13:33:28 +01:00
31bceb7570 Use PBD::FdFileDescriptor in PBD::copy_file 2014-06-25 12:40:11 -04:00
8da304be09 Fix PBD::copy_file so it works with non-ASCII filenames on windows 2014-06-25 12:40:11 -04:00
de4fc4843b Fix PBD::copy_files so that it uses O_BINARY on windows and doesn't add line endings to copied files 2014-06-25 12:40:11 -04:00
3b1a98f0ec Change PBD::get_files and PBD::get_paths to take a Searchpath instead of directory path
Both these functions use the internal function run_functor_for_paths
which takes a Searchpath so this avoids a temporary variable in cases
where a Searchpath is passed directly.

The usage is the same as the compiler will generate a temporary Searchpath
from a string(directory path) if necessary.
2014-06-25 12:40:11 -04:00
6d0cce528e Add/Update docs in pbd/file_utils.h 2014-06-25 12:40:11 -04:00
851db83fc4 Use run_functor_for_paths in PBD::get_paths 2014-06-25 12:40:10 -04:00
04434f2b88 Rename PBD::get_files_in_directory to just PBD::get_files, change parameter order and fix docs 2014-06-25 12:40:10 -04:00
84d190b7cc Rename PBD::get_directory_contents to PBD::get_paths
shorter name and change order of parameters to match other functions
2014-06-25 12:40:10 -04:00
26ec4038af Use run_functor_for_paths in PBD::find_files_matching_pattern 2014-06-25 12:40:10 -04:00
24599c552d Add function PBD::find_paths_matching_filter 2014-06-25 12:40:10 -04:00
54c0a0144c Use run_functor_for_paths in PBD::find_files_matching_filter 2014-06-25 12:40:10 -04:00
e7141d2b80 Add function to file_utils intended to be used internally 2014-06-25 12:40:10 -04:00
ab6837665f Add some debug output in file_utils.cc 2014-06-25 12:40:10 -04:00
e6c4b0e9e4 Remove reference to strtok_r now that it isn't used 2014-06-25 12:40:10 -04:00
a226068959 Change formatting of DEBUG_TRACE calls to match style guide 2014-06-25 12:40:10 -04:00
cb3a604936 Move functions in pbd/clear_dir.h/cc into pbd/file_utils.h/cc 2014-06-25 12:40:10 -04:00
cd12698b9c Rename PBD::find_file_in_search_path to just PBD::find_file
saves a bit of typing and not necessary if you look at how it is used.
2014-06-25 12:40:10 -04:00
8d0cba3384 Use PBD::find_files_matching_pattern instead of other variations 2014-06-25 12:40:10 -04:00
36fd67ab72 Add a variation of PBD::find_files_matching_pattern for convenience 2014-06-25 12:40:10 -04:00
077c09b105 Add new function PBD::find_files_matching_pattern
This new function is intended to replace the three existing
PBD::find_matching_files_* functions.

The order of parameters matches find_files_matching_regex and
find_files_matching_filter
2014-06-25 12:40:10 -04:00
d9a7d419b2 Change PBD::find_files_matching_regex and PBD::find_files_matching_filter to take a Searchpath 2014-06-25 12:40:10 -04:00
613162df6b Reimplement PBD::find_files_matching_filter using SearchPath and get_directory_contents 2014-06-25 12:40:10 -04:00
56337eade4 Remove limit parameter from PBD::find_files_matching_regex
This limit was not used or documented. The same functionality can be
performed when iterating through the results.
2014-06-25 12:40:10 -04:00
0189ad7e29 Remove parameters from PBD::find_files_matching_regex
The only users of this API always used the same options so just remove
them.
2014-06-25 12:40:09 -04:00
769ee5c1f2 Change PBD::get_files_in_directory to return full paths in result
get_files_in_directory uses get_directory_contents internally now
2014-06-25 12:40:09 -04:00
d1dd5d3ee7 Add PBD::get_directory_contents to pbd/file_utils.h 2014-06-25 12:40:09 -04:00
126ef72d05 Move the definition for 'strtok_r' (to avoid clashing with a different definition in pthread_win32) 2014-06-19 11:47:49 +01:00
547689a055 Replace all use of PathScanner with equivalent functions from pbd/file_utils.h 2014-06-17 21:41:29 +10:00
dc81ab8640 Move member functions from PathScanner to functions in pbd/file_utils.h
This allows us to remove PathScanner source file and keep PathScanner class
as header only until it is removed
2014-06-17 21:19:02 +10:00
0e96d84079 Change PBD::PathScanner API to return results by value to avoid inadvertent memory leaks 2014-06-17 21:13:05 +10:00
12cf9d5be8 fix pathscanner / stl_vector related memory leaks 2014-06-15 13:24:39 +02:00
1d85ab27a7 replace use of Gio:: with primitives (fix for #5889 part 1) 2014-03-22 17:42:26 +01:00
8ddd12a60d Rename SearchPath class Searchpath
Windows headers define SearchPath which means we have to undefine it
where necessary. This is a pain and can be tricksy, so I feel renaming
the class slightly is the easiest solution.
2013-09-06 14:31:11 +10:00
57f9a4c344 Merge branch 'windows' of git://git.ardour.org/ardour/ardour into windows 2013-07-17 08:24:36 +01:00
350ed31655 Remaining changes needed for building libpdb on Windows (except for adding the extra JE source modules) 2013-07-17 08:08:46 +01:00
e257b79ecd 'libs/pbd/file_utils.cc' didn't apply cleanly for some reason 2013-07-16 19:13:18 +01:00
ccdc6fcd6a Add DEBUG_TRACE output to file utility functions in libpbd 2013-07-13 16:55:40 -04:00
8b63e005a1 Include io.h on windows for access 2013-07-11 12:44:33 -04:00
433e3bda70 fix crash when using track templates caused by a recent change to the filescanner API. if the template contains no plugin states, the scanner would return a null pointer, and we would fail to notice 2013-04-06 11:21:09 -04:00
6b1659a29b Move file utility function into pbd/file_utils.h and into PBD namespace
git-svn-id: svn://localhost/ardour2/branches/3.0@12865 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 05:08:19 +00:00
e26e59b006 Move three file utility functions from pbd/filesystem.h to pbd/file_utils.h
git-svn-id: svn://localhost/ardour2/branches/3.0@12863 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 05:08:14 +00:00
e66e9854d7 Overwrite target file in PBD::copy_file
git-svn-id: svn://localhost/ardour2/branches/3.0@12854 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 05:07:52 +00:00
a22dd8c20a Move PBD::sys::copy_file/s into pbd/file_utils.h and PBD:: namespace
Copy files no longer depends on PBD::sys::path so move it

git-svn-id: svn://localhost/ardour2/branches/3.0@12853 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 05:07:49 +00:00
105caf23da Use std::string instead of PBD::sys::path in pbd/search_path.h, pbd/file_utils.h and ardour/session_dir.h
git-svn-id: svn://localhost/ardour2/branches/3.0@12829 d708f5d6-7413-0410-9779-e7cbd77b26cf
2012-06-23 05:06:54 +00:00
Carl Hetherington
3b89d9eaa0 Remove most using declarations from header files.
git-svn-id: svn://localhost/ardour2/branches/3.0@5069 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-05-12 17:03:42 +00:00
e0aaed6d65 *** NEW CODING POLICY ***
All #include statements that include a header that is a part of a library
bundled with ardour MUST use quotes, not angle brackets.

Do this:

#include "ardour/types.h"

NOT this:

#include <ardour/types.h>

Rationale:

This is best practice in general, to ensure we include the local version
and not the system version.  That quotes mean "local" (in some sense)
and angle brackets mean "system" (in some sense) is a ubiquitous
convention and IIRC right in the C spec somewhere.

More pragmatically, this is required by (my) waf (stuff) for dependencies
to work correctly.  That is:

!!! FAILURE TO DO THIS CAN RESULT IN BROKEN BUILDS !!!

Failure to comply is punishable by death by torture. :)

P.S. It's not that dramatic in all cases, but this (in combination with some
GCC flags specific to the include type) is the best way I have found to be
absolutely 100% positive the local ones are being used (and we definitely
want to be absolutely 100% positive on that one).


git-svn-id: svn://localhost/ardour2/branches/3.0@4655 d708f5d6-7413-0410-9779-e7cbd77b26cf
2009-02-25 18:26:51 +00:00