YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
yarpcontextutils.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef YARPCONTEXTUTILS_H
8#define YARPCONTEXTUTILS_H
9
10#include <string>
13#include <iostream>
14#include <vector>
15
16#define PATH_SEPARATOR std::string{yarp::conf::filesystem::preferred_separator}
17
19//helpers:
20bool fileCopy(std::string srcFileName, std::string destFileName, bool force=false, bool verbose=true);
21bool fileRemove(std::string fileName);
22int recursiveCopy(std::string srcDirName, std::string destDirName, bool force=false, bool verbose=true);
23int recursiveRemove(std::string dirName, bool verbose=true);
24std::vector<std::string> listContentDirs(const std::string &curPath);
25std::vector<std::string> listContentFiles(const std::string &curPath);
26void printContentDirs(const std::string &curPath);
31bool prepareSubFolders(const std::string& startDir, const std::string& fileName);
32int recursiveDiff(std::string srcDirName, std::string destDirName, std::ostream &output=std::cout);
33int fileMerge(std::string srcFileName, std::string destFileName, std::string commonParentName);
34int recursiveMerge(std::string srcDirName, std::string destDirName, std::string commonParentName, std::ostream &output=std::cout);
35
36//actual commands:
37#ifndef YARP_NO_DEPRECATED
38int import(yarp::os::Bottle& importArg, folderType fType, bool verbose=false);
39int importAll(folderType fType, bool verbose=false);
40int remove(yarp::os::Bottle& removeArg, folderType fType, bool verbose=false);
41int diff(std::string contextName, folderType fType, bool verbose=false);
42int diffList(folderType fType, bool verbose=false);
43int merge(yarp::os::Bottle& mergeArg, folderType fType, bool verbose=false);
44#else
45int import(yarp::os::Bottle& importArg, folderType fType);
46int importAll(folderType fType);
47int remove(yarp::os::Bottle& removeArg, folderType fType);
48int diff(std::string contextName, folderType fType);
49int diffList(folderType fType);
50int merge(yarp::os::Bottle& mergeArg, folderType fType);
51#endif
52
53#endif // YARPCONTEXTUTILS_H
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
Helper class for finding config files and other external resources.
int importAll(folderType fType, bool verbose=false)
int fileMerge(std::string srcFileName, std::string destFileName, std::string commonParentName)
void printSysadmFolders(yarp::os::ResourceFinder &rf, folderType ftype)
void prepareHomeFolder(yarp::os::ResourceFinder &rf, folderType ftype)
int recursiveRemove(std::string dirName, bool verbose=true)
void printInstalledFolders(yarp::os::ResourceFinder &rf, folderType ftype)
bool fileCopy(std::string srcFileName, std::string destFileName, bool force=false, bool verbose=true)
void printUserFolders(yarp::os::ResourceFinder &rf, folderType ftype)
int merge(yarp::os::Bottle &mergeArg, folderType fType, bool verbose=false)
folderType
@ CONTEXTS
@ ROBOTS
int diffList(folderType fType, bool verbose=false)
void printContentDirs(const std::string &curPath)
std::vector< std::string > listContentDirs(const std::string &curPath)
int recursiveCopy(std::string srcDirName, std::string destDirName, bool force=false, bool verbose=true)
std::vector< std::string > listContentFiles(const std::string &curPath)
int diff(std::string contextName, folderType fType, bool verbose=false)
int recursiveDiff(std::string srcDirName, std::string destDirName, std::ostream &output=std::cout)
bool prepareSubFolders(const std::string &startDir, const std::string &fileName)
bool fileRemove(std::string fileName)
int remove(yarp::os::Bottle &removeArg, folderType fType, bool verbose=false)
int recursiveMerge(std::string srcDirName, std::string destDirName, std::string commonParentName, std::ostream &output=std::cout)