gdcmPreamble.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMPREAMBLE_H
#define GDCMPREAMBLE_H
#include "gdcmTypes.h"
#include "gdcmVL.h"
namespace gdcm
{
class GDCM_EXPORT Preamble
{
public:
Preamble();
~Preamble();
friend std::ostream &operator<<(std::ostream &_os, const Preamble &_val);
void Clear();
void Valid();
void Create();
void Remove();
std::istream &Read(std::istream &is);
std::ostream const &Write(std::ostream &os) const;
void Print(std::ostream &os) const;
const char *GetInternal() const { return Internal; }
bool IsEmpty() const { return !Internal; }
VL GetLength() const { return 128 + 4; }
Preamble(Preamble const &):Internal(nullptr)
{
Create();
}
Preamble& operator=(Preamble const &)
{
Create();
return *this;
}
protected:
//
bool IsValid() const {
// is (IsValid == true) => Internal was read
return true;
}
private:
char *Internal;
};
//-----------------------------------------------------------------------------
inline std::ostream& operator<<(std::ostream &os, const Preamble &val)
{
os << val.Internal;
return os;
}
} // end namespace gdcm
#endif //GDCMPREAMBLE_H
gdcm::Preamble::Preamble
Preamble(Preamble const &)
Definition gdcmPreamble.h:60
gdcm::Preamble::IsValid
bool IsValid() const
Definition gdcmPreamble.h:71
gdcm::Preamble::Preamble
Preamble()
gdcm::Preamble::Clear
void Clear()
Clear.
gdcm::Preamble::Print
void Print(std::ostream &os) const
Print Preamble.
gdcm::Preamble::Remove
void Remove()
gdcm::Preamble::Valid
void Valid()
Set Preamble to the default one.
gdcm::Preamble::IsEmpty
bool IsEmpty() const
Check if Preamble is empty.
Definition gdcmPreamble.h:55
gdcm::Preamble::Write
std::ostream const & Write(std::ostream &os) const
Write Preamble.
gdcm::Preamble::Read
std::istream & Read(std::istream &is)
Read Preamble.
gdcm::Preamble::Create
void Create()
gdcm::Preamble::operator=
Preamble & operator=(Preamble const &)
Definition gdcmPreamble.h:64
gdcm::Preamble::GetLength
VL GetLength() const
Return size of Preamble.
Definition gdcmPreamble.h:58
gdcm::Preamble::~Preamble
~Preamble()
gdcm::Preamble::operator<<
friend std::ostream & operator<<(std::ostream &_os, const Preamble &_val)
Definition gdcmPreamble.h:80
gdcm::Preamble::GetInternal
const char * GetInternal() const
Get internal pointer to preamble.
Definition gdcmPreamble.h:52
gdcm::VL
Value Length.
Definition gdcmVL.h:30
gdcmTypes.h
gdcmVL.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88