Isis 3 Developer Reference
Blob.h
Go to the documentation of this file.
1 #ifndef Blob_h
2 #define Blob_h
3 
26 #include <string>
27 #include "PvlObject.h"
28 
29 namespace Isis {
30  bool IsBlob(PvlObject &obj);
31  class Pvl;
64  class Blob {
65  public:
66  Blob(const QString &name, const QString &type);
67  Blob(const QString &name, const QString &type,
68  const QString &file);
69  Blob(const Blob &other);
70  Blob &operator=(const Blob &other);
71 
72  virtual ~Blob();
73 
74  QString Type() const;
75  QString Name() const;
76  int Size() const;
77  PvlObject &Label();
78 
79  void Read(const QString &file);
80  void Read(const QString &file, const Pvl &pvlLabels);
81  virtual void Read(const Pvl &pvl, std::istream &is);
82 
83  void Write(const QString &file);
84  void Write(Pvl &pvl, std::fstream &stm,
85  const QString &detachedFileName = "");
86 
87  protected:
88  void Find(const Pvl &pvl);
89  virtual void ReadInit();
90  virtual void ReadData(std::istream &is);
91  virtual void WriteInit();
92  virtual void WriteData(std::fstream &os);
93 
95  QString p_blobName;
96 
97  char *p_buffer;
99  int p_nbytes;
100  QString p_type;
101  QString p_detached;
102  QString p_labelFile;
103  };
104 };
105 
106 #endif
long long int BigInt
Big int.
Definition: Constants.h:65
QString p_type
Type of data stored in the buffer.
Definition: Blob.h:100
QString p_detached
Used for reading detached blobs.
Definition: Blob.h:101
QString p_blobName
Name of the Blob object.
Definition: Blob.h:95
void Read(const QString &file)
This method reads Pvl values from a specified file.
Definition: Blob.cpp:243
virtual void WriteData(std::fstream &os)
Writes blob data to a stream.
Definition: Blob.cpp:502
void Write(const QString &file)
Write the blob data out to a file.
Definition: Blob.cpp:369
int Size() const
Accessor method that returns the number of bytes in the blob data.
Definition: Blob.cpp:158
bool IsBlob(PvlObject &obj)
Checks pvl object and returns whether or not it is a Blob.
Definition: Blob.cpp:518
int p_nbytes
Size of blob data (in bytes)
Definition: Blob.h:99
QString p_labelFile
The file containing the labels.
Definition: Blob.h:102
PvlObject p_blobPvl
Pvl Blob object.
Definition: Blob.h:94
virtual void WriteInit()
This virtual method for classes that inherit Blob.
Definition: Blob.cpp:492
virtual void ReadData(std::istream &is)
Read binary data from an input stream into the Blob object.
Definition: Blob.cpp:340
char * p_buffer
Buffer blob data is stored in.
Definition: Blob.h:97
virtual ~Blob()
Destroys the Blob object.
Definition: Blob.cpp:131
Definition: Blob.h:64
Container for cube-like labels.
Definition: Pvl.h:135
Blob & operator=(const Blob &other)
This makes the two blob objects exactly the same (copies the blob)
Definition: Blob.cpp:108
QString Name() const
Accessor method that returns a string containing the Blob name.
Definition: Blob.cpp:149
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
PvlObject & Label()
Accessor method that returns a PvlObject containing the Blob label.
Definition: Blob.cpp:167
virtual void ReadInit()
This virtual method for classes that inherit Blob.
Definition: Blob.cpp:330
void Find(const Pvl &pvl)
This method searches the given Pvl for the Blob by the Blob&#39;s type and name.
Definition: Blob.cpp:179
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
BigInt p_startByte
Byte blob data starts at in buffer.
Definition: Blob.h:98
QString Type() const
Accessor method that returns a string containing the Blob type.
Definition: Blob.cpp:140
Blob(const QString &name, const QString &type)
Constructs a Blob object using a name and type.
Definition: Blob.cpp:44