mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Add straycat handling functions.
This commit is contained in:
parent
3fb7429f60
commit
171669c3a4
2 changed files with 28 additions and 0 deletions
|
@ -51,6 +51,7 @@ struct csync_rename_s {
|
|||
}
|
||||
};
|
||||
std::vector<renameop> todo;
|
||||
std::vector<std::string> straycats;
|
||||
};
|
||||
|
||||
static int _csync_rename_record(void *obj, void *data) {
|
||||
|
@ -91,4 +92,26 @@ char* csync_rename_adjust_path(CSYNC* ctx, const char* path)
|
|||
return c_strdup(path);
|
||||
}
|
||||
|
||||
void csync_add_journal_straycat(CSYNC *ctx, const char *filename)
|
||||
{
|
||||
csync_rename_s* d = csync_rename_s::get(ctx);
|
||||
if(d)
|
||||
d->straycats.push_back( std::string(filename));
|
||||
}
|
||||
|
||||
int csync_straycat_count(CSYNC *ctx)
|
||||
{
|
||||
csync_rename_s* d = csync_rename_s::get(ctx);
|
||||
if(d)
|
||||
return d->straycats.size();
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *csync_straycat_at(CSYNC *ctx, int pos )
|
||||
{
|
||||
csync_rename_s* d = csync_rename_s::get(ctx);
|
||||
if(d)
|
||||
return d->straycats.at(pos).c_str();
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -29,6 +29,11 @@ extern "C" {
|
|||
char *csync_rename_adjust_path(CSYNC *ctx, const char *path);
|
||||
void csync_rename_destroy(CSYNC *ctx);
|
||||
void csync_rename_record(CSYNC *ctx, const char *from, const char *to);
|
||||
void csync_add_journal_straycat(CSYNC *ctx, const char* filename);
|
||||
|
||||
int csync_straycat_count(CSYNC *ctx);
|
||||
const char *csync_straycat_at(CSYNC *ctx, int pos );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue