FileAdapter is a DataAdapter that reads and writes files with methods readFile and writeFile respectively.
More...
|
static OutputTables | readFile (const std::string &fileName) |
| Read a file with the given name. More...
|
|
static void | writeFile (const InputTables &tables, const std::string &fileName) |
| Write a collection of tables to the given file. More...
|
|
static std::string | findExtension (const std::string &filename) |
| Find the extension from a filename. More...
|
|
static std::vector< std::string > | getNextLine (std::istream &stream, const std::string &delims) |
| Get the next line from the stream and tokenize/split the line using the given delimiters. More...
|
|
static bool | registerDataAdapter (const std::string &identifier, const DataAdapter &adapter) |
| Register a concrete DataAdapter by its unique string identifier. More...
|
|
|
static std::vector< std::string > | tokenize (const std::string &str, const std::string &delims) |
| Tokenize/split a given string using the given delimiters. More...
|
|
static std::shared_ptr< DataAdapter > | createAdapter (const std::string &identifier) |
| Creator of concrete DataAdapter(s) for the specified source type by its unique identifier (string). More...
|
|
FileAdapter is a DataAdapter that reads and writes files with methods readFile and writeFile respectively.
◆ FileAdapter() [1/3]
OpenSim::FileAdapter::FileAdapter |
( |
| ) |
|
|
default |
◆ FileAdapter() [2/3]
OpenSim::FileAdapter::FileAdapter |
( |
const FileAdapter & |
| ) |
|
|
default |
◆ FileAdapter() [3/3]
◆ ~FileAdapter()
virtual OpenSim::FileAdapter::~FileAdapter |
( |
| ) |
|
|
virtualdefault |
◆ findExtension()
static std::string OpenSim::FileAdapter::findExtension |
( |
const std::string & |
filename | ) |
|
|
static |
Find the extension from a filename.
◆ getNextLine()
static std::vector<std::string> OpenSim::FileAdapter::getNextLine |
( |
std::istream & |
stream, |
|
|
const std::string & |
delims |
|
) |
| |
|
static |
Get the next line from the stream and tokenize/split the line using the given delimiters.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ readFile()
static OutputTables OpenSim::FileAdapter::readFile |
( |
const std::string & |
fileName | ) |
|
|
static |
◆ tokenize()
static std::vector<std::string> OpenSim::FileAdapter::tokenize |
( |
const std::string & |
str, |
|
|
const std::string & |
delims |
|
) |
| |
|
staticprotected |
Tokenize/split a given string using the given delimiters.
The delimiters are each required to be one character and the string is split if/when any of those characters are found. For example, a delimiter string " \t" specifies that either a space or a tab can act as the delimiter.
◆ writeFile()
static void OpenSim::FileAdapter::writeFile |
( |
const InputTables & |
tables, |
|
|
const std::string & |
fileName |
|
) |
| |
|
static |
Write a collection of tables to the given file.
Different file formats require different number/type of tables. See specific adapter's documentation to see what is required.
The documentation for this class was generated from the following file:
- OpenSim/Common/FileAdapter.h