GME  13
Typedefs | Functions
Path-based delta drivers
Delta generation and handling
Collaboration diagram for Path-based delta drivers:

Typedefs

typedef svn_error_t *(* svn_delta_path_driver_cb_func_t )(void **dir_baton, void *parent_baton, void *callback_baton, const char *path, apr_pool_t *pool)

Functions

svn_error_tsvn_delta_path_driver2 (const svn_delta_editor_t *editor, void *edit_baton, const apr_array_header_t *paths, svn_boolean_t sort_paths, svn_delta_path_driver_cb_func_t callback_func, void *callback_baton, apr_pool_t *scratch_pool)
SVN_DEPRECATED svn_error_tsvn_delta_path_driver (const svn_delta_editor_t *editor, void *edit_baton, svn_revnum_t revision, const apr_array_header_t *paths, svn_delta_path_driver_cb_func_t callback_func, void *callback_baton, apr_pool_t *scratch_pool)

Detailed Description

Path-based editor drives.


Typedef Documentation

typedef svn_error_t*(* svn_delta_path_driver_cb_func_t)(void **dir_baton, void *parent_baton, void *callback_baton, const char *path, apr_pool_t *pool)

Callback function type for svn_delta_path_driver().

The handler of this callback is given the callback baton callback_baton, path which is a relpath relative to the root of the edit, and the parent_baton which represents path's parent directory as created by the editor passed to svn_delta_path_driver().

If path represents a directory, the handler must return a *dir_baton for path, generated from the same editor (so that the driver can later close that directory).

If, however, path represents a file, the handler should NOT return any file batons. It can close any opened or added files immediately, or delay that close until the end of the edit when svn_delta_path_driver() returns.

Finally, if parent_baton is NULL, then the root of the edit is also one of the paths passed to svn_delta_path_driver(). The handler of this callback must call the editor's open_root() function and return the top-level root dir baton in *dir_baton.

Definition at line 1224 of file svn_delta.h.


Function Documentation

SVN_DEPRECATED svn_error_t* svn_delta_path_driver ( const svn_delta_editor_t editor,
void *  edit_baton,
svn_revnum_t  revision,
const apr_array_header_t paths,
svn_delta_path_driver_cb_func_t  callback_func,
void *  callback_baton,
apr_pool_t scratch_pool 
)

Similar to svn_delta_path_driver2, but takes an (unused) revision, and will sort the provided paths using svn_sort_compare_paths.

Note:
In versions prior to 1.8, this function would modify the order of elements in paths, despite the 'const' marker on the parameter. This has been fixed in 1.8.
Deprecated:
Provided for backward compatibility with the 1.7 API.
svn_error_t* svn_delta_path_driver2 ( const svn_delta_editor_t editor,
void *  edit_baton,
const apr_array_header_t paths,
svn_boolean_t  sort_paths,
svn_delta_path_driver_cb_func_t  callback_func,
void *  callback_baton,
apr_pool_t scratch_pool 
)

Drive editor (with its edit_baton) to visit each path in paths. As each path is hit as part of the editor drive, use callback_func and callback_baton to allow the caller to handle the portion of the editor drive related to that path.

Each path in paths is a (const char *) relpath, relative to the root path of the edit. The editor drive will be performed in the same order as paths. The paths should be sorted using something like svn_sort_compare_paths to ensure that a depth-first pattern is observed for directory/file baton creation. If sort_paths is set, the function will sort the paths for you. Some callers may need further customization of the order (ie. libsvn_delta/compat.c).

Use scratch_pool for all necessary allocations.

Since:
New in 1.8.