ROSE 0.11.145.147
|
Input binary analysis state.
Reads a previously saved binary analysis state file to re-initialize ROSE to a previous state.
Definition at line 439 of file SerialIo.h.
#include <Rose/BinaryAnalysis/SerialIo.h>
Public Types | |
using | Ptr = SerialInputPtr |
Reference counting pointer. | |
Public Types inherited from Rose::BinaryAnalysis::SerialIo | |
enum | Format { BINARY , TEXT , XML } |
Format of the state file. More... | |
enum | Savable { NO_OBJECT = 0x00000000 , PARTITIONER = 0x00000001 , AST = 0x00000002 , END_OF_DATA = 0x0000fffe , ERROR = 0x0000ffff , USER_DEFINED = 0x00010000 , USER_DEFINED_LAST = 0xffffffff } |
Types of objects that can be saved. More... | |
using | Ptr = SerialIoPtr |
Reference counting pointer. | |
Public Member Functions | |
void | open (const boost::filesystem::path &fileName) override |
Attach a file. | |
void | close () override |
Detach a file. | |
Savable | nextObjectType () |
Type of next object in the input stream. | |
Partitioner2::PartitionerPtr | loadPartitioner () |
Load a partitioner from the input stream. | |
SgNode * | loadAst () |
Load an AST from the input stream. | |
template<class T > | |
T | loadObject (Savable objectTypeId) |
Load an object from the input stream. | |
template<class T > | |
void | loadObject (Savable objectTypeId, T &object) |
Load an object from the input stream. | |
Public Member Functions inherited from Rose::BinaryAnalysis::SerialIo | |
virtual | ~SerialIo () |
Destructor. | |
bool | isOpen () const |
Whether a file is attached. | |
Savable | objectType () const |
Type ID for next object. | |
Format | format () const |
Property: File format. | |
void | format (Format) |
Property: File format. | |
Progress::Ptr | progress () const |
Property: Progress reporter. | |
void | progress (const Progress::Ptr &) |
Property: Progress reporter. | |
Public Member Functions inherited from Sawyer::SharedObject | |
SharedObject () | |
Default constructor. | |
SharedObject (const SharedObject &) | |
Copy constructor. | |
virtual | ~SharedObject () |
Virtual destructor. | |
SharedObject & | operator= (const SharedObject &) |
Assignment. | |
Static Public Member Functions | |
static Ptr | instance () |
Factory method to create a new instance. | |
Static Public Member Functions inherited from Rose::BinaryAnalysis::SerialIo | |
static Savable | userSavable (unsigned offset) |
Create a new Savable enum constant. | |
Protected Member Functions | |
void | advanceObjectType () |
Protected Member Functions inherited from Rose::BinaryAnalysis::SerialIo | |
void | setIsOpen (bool b) |
void | objectType (Savable) |
Additional Inherited Members | |
Static Public Attributes inherited from Rose::BinaryAnalysis::SerialIo | |
static Sawyer::Message::Facility | mlog |
Message facility. | |
Protected Attributes inherited from Rose::BinaryAnalysis::SerialIo | |
Sawyer::ProgressBar< size_t > | progressBar_ |
int | fd_ |
Reference counting pointer.
Definition at line 442 of file SerialIo.h.
|
inlineprotected |
Definition at line 456 of file SerialIo.h.
|
overridevirtual |
Attach a file.
When opening an output stream, the file is created or truncated; when opening an input stream the file must already exist. If a file is already attached, then the previous file is closed first before this new one is opened.
Throws an Exception if the file cannot be attached or the previous if any, cannot be closed.
Thread safety: This method is not thread-safe.
Implements Rose::BinaryAnalysis::SerialIo.
|
overridevirtual |
Detach a file.
If a file is attached to this I/O object, that file is closed and this object is set to its detached state. This is a no-op if no file is attached.
Throws an Exception if the file cannot be detached.
The close method is automatically called during object destruction, although its exceptions are suppressed in that situation.
Thread safety: This method is not thread-safe.
Implements Rose::BinaryAnalysis::SerialIo.
|
inlinestatic |
Factory method to create a new instance.
The returned instance is in a detached state, therefore the open method needs to be called before any I/O operation can be invoked.
Definition at line 470 of file SerialIo.h.
Savable Rose::BinaryAnalysis::SerialInput::nextObjectType | ( | ) |
Type of next object in the input stream.
Returns an indication for the type of the next item in the input stream.
Throws an Exception if no file is attached.
Thread safety: This method is not thread safe.
Partitioner2::PartitionerPtr Rose::BinaryAnalysis::SerialInput::loadPartitioner | ( | ) |
Load a partitioner from the input stream.
Initializes the specified partitioner with data from the input stream.
Throws an Exception if no file is attached to this I/O object or if the next object to be read from the input is not a partitioner, or if any other errors occur while reading the partitioner.
SgNode * Rose::BinaryAnalysis::SerialInput::loadAst | ( | ) |
Load an AST from the input stream.
Loads an AST from the intput stream and returns a pointer to its root. If a null AST was stored, then a null pointer is returned.
Throws an Exception if no file is attached to this I/O object or if the next object to be read from the input is not an AST, or if any other errors occur while reading the AST.
|
inline |
Load an object from the input stream.
An object with the specified tag must exist as the next item in the stream. Such an object is created, initialized from the stream, and returned. If an object is provided as the second argument, then it's initialized from the stream.
Definition at line 505 of file SerialIo.h.
|
inline |
Load an object from the input stream.
An object with the specified tag must exist as the next item in the stream. Such an object is created, initialized from the stream, and returned. If an object is provided as the second argument, then it's initialized from the stream.
Definition at line 511 of file SerialIo.h.
References Rose::BinaryAnalysis::SerialIo::ERROR, Rose::BinaryAnalysis::SerialIo::isOpen(), Sawyer::ProgressBarSettings::minimumUpdateInterval(), Rose::BinaryAnalysis::SerialIo::objectType(), Sawyer::ProgressBar< T, S >::prefix(), Rose::BinaryAnalysis::SerialIo::progress(), and Sawyer::ProgressBar< T, S >::value().