NeXus
1
|
The Object that allows access to the information in the file. More...
#include <bindings/cpp/NeXusFile.hpp>
Public Member Functions | |
std::pair< std::string, std::string > | getNextEntry () |
AttrInfo | getNextAttr () |
File (const std::string &filename, const NXaccess access=NXACC_READ) | |
Create a new File. | |
File (const char *filename, const NXaccess access=NXACC_READ) | |
Create a new File. | |
File (NXhandle handle, bool close_handle=false) | |
Use an existing handle returned from NXopen() | |
~File () | |
Destructor. | |
void | close () |
Close the file before the constructor is called. | |
void | flush () |
Flush the file. | |
template<typename NumT > | |
void | malloc (NumT *&data, const Info &info) |
template<typename NumT > | |
void | free (NumT *&data) |
void | makeGroup (const std::string &name, const std::string &class_name, bool open_group=false) |
Create a new group. | |
void | openGroup (const std::string &name, const std::string &class_name) |
Open an existing group. | |
void | openPath (const std::string &path) |
Open the NeXus object with the path specified. | |
void | openGroupPath (const std::string &path) |
Open the group in which the NeXus object with the specified path exists. | |
std::string | getPath () |
Get the path into the current file. | |
void | closeGroup () |
Close the currently open group. | |
void | makeData (const std::string &name, NXnumtype type, const std::vector< int > &dims, bool open_data=false) |
(const std::string&, NXnumtype, (const std::string&, NXnumtype, | |
void | makeData (const std::string &name, NXnumtype type, const std::vector< int64_t > &dims, bool open_data=false) |
Create a data field with the specified information. | |
template<typename NumT > | |
void | makeData (const std::string &name, const NXnumtype type, const NumT length, bool open_data=false) |
Create a 1D data field with the specified information. | |
void | writeData (const std::string &name, const std::string &value) |
Create a 1D data field, insert the data, and close the data. | |
void | writeData (const std::string &name, const char *value) |
Create a 1D data field, insert the data, and close the data. | |
template<typename NumT > | |
void | writeData (const std::string &name, const std::vector< NumT > &value) |
Create a 1D data field, insert the data, and close the data. | |
template<typename NumT > | |
void | writeData (const std::string &name, const NumT &value) |
Create a 1D data field, insert the data, and close the data. | |
template<typename NumT > | |
void | writeData (const std::string &name, const std::vector< NumT > &value, const std::vector< int > &dims) |
Create a n-dimension data field, insert the data, and close the data. | |
template<typename NumT > | |
void | writeData (const std::string &name, const std::vector< NumT > &value, const std::vector< int64_t > &dims) |
Create a n-dimension data field, insert the data, and close the data. | |
template<typename NumT > | |
void | writeExtendibleData (const std::string &name, std::vector< NumT > &value) |
Create a 1D data field with an unlimited dimension, insert the data, and close the data. | |
template<typename NumT > | |
void | writeExtendibleData (const std::string &name, std::vector< NumT > &value, const int64_t chunk) |
Create a 1D data field with an unlimited dimension, insert the data, and close the data. | |
template<typename NumT > | |
void | writeExtendibleData (const std::string &name, std::vector< NumT > &value, std::vector< int64_t > &dims, std::vector< int64_t > &chunk) |
Create a 1D data field with an unlimited dimension, insert the data, and close the data. | |
template<typename NumT > | |
void | writeUpdatedData (const std::string &name, std::vector< NumT > &value) |
Updates the data written into an already-created data vector. | |
template<typename NumT > | |
void | writeUpdatedData (const std::string &name, std::vector< NumT > &value, std::vector< int64_t > &dims) |
Updates the data written into an already-created data vector. | |
void | makeCompData (const std::string &name, const NXnumtype type, const std::vector< int > &dims, const NXcompression comp, const std::vector< int > &bufsize, bool open_data=false) |
(const std::string&, const NXnumtype, (const std::string&, const NXnumtype, | |
void | makeCompData (const std::string &name, const NXnumtype type, const std::vector< int64_t > &dims, const NXcompression comp, const std::vector< int64_t > &bufsize, bool open_data=false) |
Create a field with compression. | |
template<typename NumT > | |
void | writeCompData (const std::string &name, const std::vector< NumT > &value, const std::vector< int > &dims, const NXcompression comp, const std::vector< int > &bufsize) |
(const std::string & name, (const std::string & name, | |
template<typename NumT > | |
void | writeCompData (const std::string &name, const std::vector< NumT > &value, const std::vector< int64_t > &dims, const NXcompression comp, const std::vector< int64_t > &bufsize) |
Create a compressed data, insert the data, and close it. | |
void | openData (const std::string &name) |
void | closeData () |
Close the currently open data. | |
void | putData (const void *data) |
template<typename NumT > | |
void | putData (const std::vector< NumT > &data) |
void | putAttr (const AttrInfo &info, const void *data) |
Put the supplied data as an attribute into the currently open data. | |
template<typename NumT > | |
void | putAttr (const std::string &name, const NumT value) |
Put the supplied data as an attribute into the currently open data. | |
void | putAttr (const char *name, const char *value) |
Put a string as an attribute in the file. | |
void | putAttr (const std::string &name, const std::string value) |
Put a string as an attribute in the file. | |
void | putSlab (void *data, std::vector< int > &start, std::vector< int > &size) |
(void* data, std::vector<int64_t>& start, (void* data, std::vector<int64_t>& start, | |
void | putSlab (void *data, std::vector< int64_t > &start, std::vector< int64_t > &size) |
Insert an array as part of a data in the final file. | |
template<typename NumT > | |
void | putSlab (std::vector< NumT > &data, std::vector< int > &start, std::vector< int > &size) |
(void* data, std::vector<int64_t>& start, (std::vector<NumT>& data, std::vector<int64_t>&, | |
template<typename NumT > | |
void | putSlab (std::vector< NumT > &data, std::vector< int64_t > &start, std::vector< int64_t > &size) |
Insert an array as part of a data in the final file. | |
template<typename NumT > | |
void | putSlab (std::vector< NumT > &data, int start, int size) |
Insert a number as part of a data in the final file. | |
template<typename NumT > | |
void | putSlab (std::vector< NumT > &data, int64_t start, int64_t size) |
Insert a number as part of a data in the final file. | |
NXlink | getDataID () |
void | makeLink (NXlink &link) |
Create a link in the current location to the supplied id. | |
void | makeNamedLink (const std::string &name, NXlink &link) |
Create a link with a new name. | |
void | openSourceGroup () |
Open the original copy of this group or data as declared by the "target" attribute. | |
void | getData (void *data) |
Put the currently open data in the supplied pointer. | |
template<typename NumT > | |
std::vector< NumT > * | getData () |
Allocate memory and return the data as a vector. | |
template<typename NumT > | |
void | getData (std::vector< NumT > &data) |
Put data into the supplied vector. | |
void | getDataCoerce (std::vector< int > &data) |
Get data and coerce into an int vector. | |
void | getDataCoerce (std::vector< double > &data) |
Get data and coerce into a vector of doubles. | |
bool | isDataInt () |
Return true if the data opened is of one of the int data types, 32 bits or less. | |
template<typename NumT > | |
void | readData (const std::string &dataName, std::vector< NumT > &data) |
Put data into the supplied vector. | |
template<typename NumT > | |
void | readData (const std::string &dataName, NumT &data) |
Put data into the supplied value. | |
void | readData (const std::string &dataName, std::string &data) |
Put data into the supplied string. | |
std::string | getStrData () |
Info | getInfo () |
std::map< std::string, std::string > | getEntries () |
Return the entries available in the current place in the file. | |
void | getEntries (std::map< std::string, std::string > &result) |
Return the entries available in the current place in the file, but avoids the map copy of getEntries(). | |
void | getSlab (void *data, const std::vector< int > &start, const std::vector< int > &size) |
(void*, const std::vector<int64_t>&, (void*, const std::vector<int64_t>&, | |
void | getSlab (void *data, const std::vector< int64_t > &start, const std::vector< int64_t > &size) |
Get a section of data from the file. | |
std::vector< AttrInfo > | getAttrInfos () |
bool | hasAttr (const std::string &name) |
void | getAttr (const AttrInfo &info, void *data, int length=-1) |
Get the value of the attribute specified by the AttrInfo supplied. | |
template<typename NumT > | |
NumT | getAttr (const AttrInfo &info) |
Get the value of an attribute that is a scalar number. | |
template<typename NumT > | |
void | getAttr (const std::string &name, NumT &value) |
Get the value of an attribute that is a scalar number. | |
std::string | getStrAttr (const AttrInfo &info) |
Get the value of a string attribute. | |
NXlink | getGroupID () |
bool | sameID (NXlink &first, NXlink &second) |
Determine whether or not two links refer to the same data or group. | |
void | printLink (NXlink &link) |
Diagnostic print of the link information. | |
void | setNumberFormat (NXnumtype &type, const std::string &format) |
Set the number format used for a particular type when using the xml base. | |
std::string | inquireFile (const int buff_length=NX_MAXPATHLEN) |
Find out the name of the file this object is holding onto. | |
std::string | isExternalGroup (const std::string &name, const std::string &type, const unsigned buff_length=NX_MAXNAMELEN) |
Determine Whether or not a supplied group is external. | |
void | linkExternal (const std::string &name, const std::string &type, const std::string &url) |
Create a link to a group in an external file. | |
bool | isDataSetOpen () |
This function checksi if we are in an open dataset. | |
TypeMap * | getTypeMap () |
Create a multimap with the data types as keys and the associated paths as values. | |
template<> | |
void | getAttr (const std::string &name, std::string &value) |
The Object that allows access to the information in the file.
Definition at line 109 of file NeXusFile.hpp.
NeXus::File::File | ( | const std::string & | filename, |
const NXaccess | access = NXACC_READ |
||
) |
Create a new File.
filename | The name of the file to open. |
access | How to access the file. |
Definition at line 164 of file NeXusFile.cpp.
NeXus::File::File | ( | const char * | filename, |
const NXaccess | access = NXACC_READ |
||
) |
Create a new File.
filename | The name of the file to open. |
access | How to access the file. |
Definition at line 168 of file NeXusFile.cpp.
NeXus::File::File | ( | NXhandle | handle, |
bool | close_handle = false |
||
) |
Use an existing handle returned from NXopen()
handle | Handle to connect to |
close_handle | Should the handle be closed on destruction |
Definition at line 161 of file NeXusFile.cpp.
NeXus::File::~File | ( | ) |
Destructor.
This does close the file.
Definition at line 185 of file NeXusFile.cpp.
References NXclose().
void NeXus::File::close | ( | ) |
Close the file before the constructor is called.
Definition at line 195 of file NeXusFile.cpp.
References NXclose().
void NeXus::File::closeData | ( | ) |
Close the currently open data.
Definition at line 513 of file NeXusFile.cpp.
References NXclosedata().
Referenced by NeXus::Stream::operator<<(), NeXus::Stream::operator>>(), readData(), NeXus::Stream::DataHolder< NumT >::readFromFile(), NeXus::Stream::Data::readFromFile(), writeCompData(), writeData(), writeExtendibleData(), NeXus::Stream::Data::writeToFile(), and writeUpdatedData().
void NeXus::File::closeGroup | ( | ) |
Close the currently open group.
Definition at line 284 of file NeXusFile.cpp.
References NXclosegroup().
Referenced by NeXus::Stream::operator<<(), and NeXus::Stream::operator>>().
void NeXus::File::flush | ( | ) |
Flush the file.
Definition at line 205 of file NeXusFile.cpp.
References NXflush().
template void File::free | ( | NumT *& | data | ) |
Definition at line 1321 of file NeXusFile.cpp.
void NeXus::File::getAttr | ( | const AttrInfo & | info, |
void * | data, | ||
int | length = -1 |
||
) |
Get the value of the attribute specified by the AttrInfo supplied.
info | Designation of which attribute to read. |
data | The pointer to put the attribute value in. |
length | The length of the attribute. If this is "-1" then the information in the supplied AttrInfo object will be used. |
Definition at line 1051 of file NeXusFile.cpp.
References NeXus::AttrInfo::length, NeXus::AttrInfo::name, NXgetattr(), and NeXus::AttrInfo::type.
Referenced by getAttr(), getStrAttr(), and NeXus::Stream::AttrHolder< NumT >::readFromFile().
template char File::getAttr | ( | const AttrInfo & | info | ) |
Get the value of an attribute that is a scalar number.
info | Designation of which attribute to read. |
NumT | numeric data type of result |
Definition at line 1081 of file NeXusFile.cpp.
References getAttr().
void NeXus::File::getAttr | ( | const std::string & | name, |
NumT & | value | ||
) |
Get the value of an attribute that is a scalar number.
[in] | name | Name of attribute to read |
[out] | value | The read attribute value. |
NumT | numeric data type of value |
Definition at line 1098 of file NeXusFile.cpp.
References NeXus::AttrInfo::length, NeXus::AttrInfo::name, and NeXus::AttrInfo::type.
void NeXus::File::getAttr | ( | const std::string & | name, |
std::string & | value | ||
) |
<
Definition at line 1088 of file NeXusFile.cpp.
References getStrAttr(), NeXus::AttrInfo::length, NeXus::AttrInfo::name, and NeXus::AttrInfo::type.
vector< AttrInfo > NeXus::File::getAttrInfos | ( | ) |
Definition at line 1136 of file NeXusFile.cpp.
References getNextAttr(), and NeXus::AttrInfo::name.
void NeXus::File::getData | ( | void * | data | ) |
Put the currently open data in the supplied pointer.
data | The pointer to copy the data to. |
Definition at line 698 of file NeXusFile.cpp.
References NXgetdata().
Referenced by NeXus::Stream::DataHolder< NumT >::readFromFile().
template vector< char > * File::getData | ( | ) |
Allocate memory and return the data as a vector.
Since this does call "new vector<NumT>" the caller is responsible for calling "delete".
NumT | numeric data type of result |
Definition at line 709 of file NeXusFile.cpp.
References NeXus::Info::dims, getInfo(), and NeXus::Info::type.
Referenced by getData(), getDataCoerce(), getStrData(), and readData().
void NeXus::File::getData | ( | std::vector< NumT > & | data | ) |
Put data into the supplied vector.
The vector does not need to be the correct size, just the correct type as it is resized to the appropriate value.
data | Where to put the data. |
NumT | numeric data type of data |
Definition at line 739 of file NeXusFile.cpp.
References NeXus::Info::dims, getData(), getInfo(), and NeXus::Info::type.
void NeXus::File::getDataCoerce | ( | std::vector< int > & | data | ) |
Get data and coerce into an int vector.
Exception | if the data is actually a float or another type that cannot be coerced to an int. |
data | :: vector to be filled. |
Definition at line 762 of file NeXusFile.cpp.
References getData(), getInfo(), NeXus::INT16, NeXus::INT32, NeXus::INT8, NeXus::Info::type, NeXus::UINT16, NeXus::UINT32, and NeXus::UINT8.
void NeXus::File::getDataCoerce | ( | std::vector< double > & | data | ) |
Get data and coerce into a vector of doubles.
Exception | if the data cannot be coerced to a double. |
data | :: vector to be filled. |
Definition at line 807 of file NeXusFile.cpp.
References NeXus::FLOAT32, NeXus::FLOAT64, getData(), getInfo(), NeXus::INT16, NeXus::INT32, NeXus::INT8, NeXus::Info::type, NeXus::UINT16, NeXus::UINT32, and NeXus::UINT8.
NXlink NeXus::File::getDataID | ( | ) |
Definition at line 651 of file NeXusFile.cpp.
References NXgetdataID().
map< string, string > NeXus::File::getEntries | ( | ) |
Return the entries available in the current place in the file.
Definition at line 974 of file NeXusFile.cpp.
void NeXus::File::getEntries | ( | std::map< std::string, std::string > & | result | ) |
Return the entries available in the current place in the file, but avoids the map copy of getEntries().
result | The map that will be filled with the entries |
Definition at line 981 of file NeXusFile.cpp.
References getNextEntry().
NXlink NeXus::File::getGroupID | ( | ) |
Definition at line 1166 of file NeXusFile.cpp.
References NXgetgroupID().
Info NeXus::File::getInfo | ( | ) |
Definition at line 936 of file NeXusFile.cpp.
References NeXus::Info::dims, and NeXus::Info::type.
Referenced by getData(), getDataCoerce(), getStrData(), and isDataInt().
AttrInfo NeXus::File::getNextAttr | ( | ) |
Definition at line 1027 of file NeXusFile.cpp.
References NeXus::AttrInfo::length, NeXus::AttrInfo::name, NXgetnextattr(), and NeXus::AttrInfo::type.
Referenced by getAttrInfos(), and hasAttr().
pair< string, string > NeXus::File::getNextEntry | ( | ) |
Definition at line 953 of file NeXusFile.cpp.
References NXgetnextentry().
Referenced by getEntries().
std::string NeXus::File::getPath | ( | ) |
Get the path into the current file.
Definition at line 271 of file NeXusFile.cpp.
References NXgetpath().
void NeXus::File::getSlab | ( | void * | data, |
const std::vector< int > & | start, | ||
const std::vector< int > & | size | ||
) |
(void*, const std::vector<int64_t>&, (void*, const std::vector<int64_t>&,
(void*, const std::vector<int64_t>&, const std::vector<int64_t>&) (void*, const std::vector<int64_t>&, const std::vector<int64_t>&)
Definition at line 998 of file NeXusFile.cpp.
void NeXus::File::getSlab | ( | void * | data, |
const std::vector< int64_t > & | start, | ||
const std::vector< int64_t > & | size | ||
) |
Get a section of data from the file.
data | The pointer to insert that data into. |
start | The offset into the file's data block to start the read from. |
size | The size of the block to read from the file. |
Definition at line 1003 of file NeXusFile.cpp.
string NeXus::File::getStrAttr | ( | const AttrInfo & | info | ) |
Get the value of a string attribute.
info | Which attribute to read. |
Definition at line 1108 of file NeXusFile.cpp.
References NeXus::CHAR, getAttr(), NeXus::AttrInfo::length, and NeXus::AttrInfo::type.
Referenced by getAttr().
string NeXus::File::getStrData | ( | ) |
Definition at line 907 of file NeXusFile.cpp.
References NeXus::Info::dims, getData(), getInfo(), and NeXus::Info::type.
Referenced by readData().
TypeMap * NeXus::File::getTypeMap | ( | ) |
Create a multimap with the data types as keys and the associated paths as values.
Definition at line 1302 of file NeXusFile.cpp.
References openPath().
bool NeXus::File::hasAttr | ( | const std::string & | name | ) |
name | the name of the attribute to look for. |
Definition at line 1150 of file NeXusFile.cpp.
References getNextAttr(), and NeXus::AttrInfo::name.
string NeXus::File::inquireFile | ( | const int | buff_length = NX_MAXPATHLEN | ) |
Find out the name of the file this object is holding onto.
buff_length | The size of the buffer to use for reading the name. |
Definition at line 1215 of file NeXusFile.cpp.
References NXinquirefile().
bool NeXus::File::isDataInt | ( | ) |
Return true if the data opened is of one of the int data types, 32 bits or less.
Definition at line 888 of file NeXusFile.cpp.
References getInfo(), NeXus::INT16, NeXus::INT32, NeXus::INT8, NeXus::Info::type, NeXus::UINT16, NeXus::UINT32, and NeXus::UINT8.
bool NeXus::File::isDataSetOpen | ( | ) |
This function checksi if we are in an open dataset.
Definition at line 660 of file NeXusFile.cpp.
References NXgetdataID().
Referenced by NeXus::Stream::operator<<(), and NeXus::Stream::operator>>().
string NeXus::File::isExternalGroup | ( | const std::string & | name, |
const std::string & | type, | ||
const unsigned | buff_length = NX_MAXNAMELEN |
||
) |
Determine Whether or not a supplied group is external.
name | The name of the group to check. |
type | The type of the group to check. |
buff_length | The size of the buffer to use for reading the url. |
Definition at line 1230 of file NeXusFile.cpp.
References NXisexternalgroup().
void NeXus::File::linkExternal | ( | const std::string & | name, |
const std::string & | type, | ||
const std::string & | url | ||
) |
Create a link to a group in an external file.
name | The name for the group in this file. |
type | The type for the group in this file. |
url | The url to the group in the external file. |
Definition at line 1253 of file NeXusFile.cpp.
References NXlinkexternal().
void NeXus::File::makeCompData | ( | const std::string & | name, |
const NXnumtype | type, | ||
const std::vector< int > & | dims, | ||
const NXcompression | comp, | ||
const std::vector< int > & | bufsize, | ||
bool | open_data = false |
||
) |
(const std::string&, const NXnumtype, (const std::string&, const NXnumtype,
(const std::string&, const NXnumtype, const std::vector<int64_t>&, const NXcompression, const std::vector<int64_t>&, bool) (const std::string&, const NXnumtype, const std::vector<int64_t>&, const NXcompression, const std::vector<int64_t>&, bool)
Definition at line 433 of file NeXusFile.cpp.
Referenced by writeCompData(), and writeExtendibleData().
void NeXus::File::makeCompData | ( | const std::string & | name, |
const NXnumtype | type, | ||
const std::vector< int64_t > & | dims, | ||
const NXcompression | comp, | ||
const std::vector< int64_t > & | bufsize, | ||
bool | open_data = false |
||
) |
Create a field with compression.
name | The name of the data to create. |
type | The primitive type for the data. |
dims | The dimensions of the data. |
comp | The compression algorithm to use. |
bufsize | The size of the compression buffer to use. |
open_data | Whether or not to open the data after creating it. |
Definition at line 439 of file NeXusFile.cpp.
References openData().
void NeXus::File::makeData | ( | const std::string & | name, |
NXnumtype | type, | ||
const std::vector< int > & | dims, | ||
bool | open_data = false |
||
) |
(const std::string&, NXnumtype, (const std::string&, NXnumtype,
(const std::string&, NXnumtype, const std::vector<int64_t>&, bool); (const std::string&, NXnumtype, const std::vector<int64_t>&, bool);
Definition at line 291 of file NeXusFile.cpp.
Referenced by makeData(), and writeData().
void NeXus::File::makeData | ( | const std::string & | name, |
NXnumtype | type, | ||
const std::vector< int64_t > & | dims, | ||
bool | open_data = false |
||
) |
Create a data field with the specified information.
name | The name of the field to create (i.e. "distance"). |
type | The primative type of the field (i.e. "NeXus::FLOAT32"). |
dims | The dimensions of the field. |
open_data | Whether or not to open the data after creating it. |
Definition at line 296 of file NeXusFile.cpp.
References openData().
void NeXus::File::makeData | ( | const std::string & | name, |
const NXnumtype | type, | ||
const NumT | length, | ||
bool | open_data = false |
||
) |
Create a 1D data field with the specified information.
name | The name of the field to create (i.e. "distance"). |
type | The primative type of the field (i.e. "NeXus::FLOAT32"). |
length | The number of elements in the field. |
open_data | Whether or not to open the data after creating it. |
Definition at line 322 of file NeXusFile.cpp.
References makeData().
void NeXus::File::makeGroup | ( | const std::string & | name, |
const std::string & | class_name, | ||
bool | open_group = false |
||
) |
Create a new group.
name | The name of the group to create (i.e. "entry"). |
class_name | The type of group to create (i.e. "NXentry"). |
open_group | Whether or not to automatically open the group after creating it. |
Definition at line 212 of file NeXusFile.cpp.
References NXmakegroup(), and openGroup().
Referenced by NeXus::Stream::Group::writeToFile().
void NeXus::File::makeLink | ( | NXlink & | link | ) |
Create a link in the current location to the supplied id.
link | The object (group or data) in the file to link to. |
Definition at line 674 of file NeXusFile.cpp.
References NXmakelink().
void NeXus::File::makeNamedLink | ( | const std::string & | name, |
NXlink & | link | ||
) |
Create a link with a new name.
name | The name of this copy of the link. |
link | The object (group or data) in the file to link to. |
Definition at line 681 of file NeXusFile.cpp.
References NXmakenamedlink().
template void File::malloc | ( | NumT *& | data, |
const Info & | info | ||
) |
Definition at line 1311 of file NeXusFile.cpp.
References NeXus::Info::dims, and NeXus::Info::type.
void NeXus::File::openData | ( | const std::string & | name | ) |
name | The name of the data to open. |
Definition at line 503 of file NeXusFile.cpp.
References NXopendata().
Referenced by makeCompData(), makeData(), readData(), NeXus::Stream::DataHolder< NumT >::readFromFile(), NeXus::Stream::Data::readFromFile(), NeXus::Stream::Data::writeToFile(), and writeUpdatedData().
void NeXus::File::openGroup | ( | const std::string & | name, |
const std::string & | class_name | ||
) |
Open an existing group.
name | The name of the group to create (i.e. "entry"). |
class_name | The type of group to create (i.e. "NXentry"). |
Definition at line 231 of file NeXusFile.cpp.
References NXopengroup().
Referenced by makeGroup(), and NeXus::Stream::Group::readFromFile().
void NeXus::File::openGroupPath | ( | const std::string & | path | ) |
Open the group in which the NeXus object with the specified path exists.
path | A unix like path string to a group or field. The path string is a list of group names and SDS names separated with a slash, '/' (i.e. "/entry/sample/name"). |
Definition at line 259 of file NeXusFile.cpp.
References NXopengrouppath().
void NeXus::File::openPath | ( | const std::string & | path | ) |
Open the NeXus object with the path specified.
path | A unix like path string to a group or field. The path string is a list of group names and SDS names separated with a slash, '/' (i.e. "/entry/sample/name"). |
Definition at line 247 of file NeXusFile.cpp.
References NXopenpath().
Referenced by getTypeMap().
void NeXus::File::openSourceGroup | ( | ) |
Open the original copy of this group or data as declared by the "target" attribute.
Definition at line 691 of file NeXusFile.cpp.
References NXopensourcegroup().
void NeXus::File::printLink | ( | NXlink & | link | ) |
Diagnostic print of the link information.
link | The link to print to stdout. |
Definition at line 1180 of file NeXusFile.cpp.
void NeXus::File::putAttr | ( | const AttrInfo & | info, |
const void * | data | ||
) |
Put the supplied data as an attribute into the currently open data.
info | Description of the attribute to add. |
data | The attribute value. |
Definition at line 538 of file NeXusFile.cpp.
References NeXus::AttrInfo::length, NeXus::AttrInfo::name, NXputattr(), and NeXus::AttrInfo::type.
Referenced by putAttr(), and NeXus::Stream::AttrHolder< NumT >::writeToFile().
void NeXus::File::putAttr | ( | const std::string & | name, |
const NumT | value | ||
) |
Put the supplied data as an attribute into the currently open data.
name | Name of the attribute to add. |
value | The attribute value. |
NumT | numeric data type of value |
Definition at line 557 of file NeXusFile.cpp.
References NeXus::AttrInfo::length, NeXus::AttrInfo::name, putAttr(), and NeXus::AttrInfo::type.
void NeXus::File::putAttr | ( | const char * | name, |
const char * | value | ||
) |
Put a string as an attribute in the file.
name | Name of the attribute to add. |
value | The attribute value. |
Definition at line 565 of file NeXusFile.cpp.
References putAttr().
void NeXus::File::putAttr | ( | const std::string & | name, |
const std::string | value | ||
) |
Put a string as an attribute in the file.
name | Name of the attribute to add. |
value | The attribute value. |
Definition at line 577 of file NeXusFile.cpp.
References NeXus::CHAR, NeXus::AttrInfo::length, NeXus::AttrInfo::name, putAttr(), and NeXus::AttrInfo::type.
void NeXus::File::putData | ( | const void * | data | ) |
data | The data to put in the file. |
Definition at line 520 of file NeXusFile.cpp.
References NXputdata().
Referenced by putData(), writeCompData(), and writeData().
void NeXus::File::putData | ( | const std::vector< NumT > & | data | ) |
data | The data to put in the file. |
NumT | numeric data type of data |
Definition at line 531 of file NeXusFile.cpp.
References putData().
void NeXus::File::putSlab | ( | void * | data, |
std::vector< int > & | start, | ||
std::vector< int > & | size | ||
) |
(void* data, std::vector<int64_t>& start, (void* data, std::vector<int64_t>& start,
(void* data, std::vector<int64_t>& start, std::vector<int64_t>& size) (void* data, std::vector<int64_t>& start, std::vector<int64_t>& size)
Definition at line 588 of file NeXusFile.cpp.
Referenced by putSlab(), writeExtendibleData(), and writeUpdatedData().
void NeXus::File::putSlab | ( | void * | data, |
std::vector< int64_t > & | start, | ||
std::vector< int64_t > & | size | ||
) |
Insert an array as part of a data in the final file.
data | The array to put in the file. |
start | The starting index to insert the data. |
size | The size of the array to put in the file. |
Definition at line 594 of file NeXusFile.cpp.
void NeXus::File::putSlab | ( | std::vector< NumT > & | data, |
std::vector< int > & | start, | ||
std::vector< int > & | size | ||
) |
(void* data, std::vector<int64_t>& start, (std::vector<NumT>& data, std::vector<int64_t>&,
(void* data, std::vector<int64_t>& start, std::vector<int64_t>& size) (std::vector<NumT>& data, std::vector<int64_t>&, std::vector<int64_t>&)
Definition at line 621 of file NeXusFile.cpp.
References putSlab().
void NeXus::File::putSlab | ( | std::vector< NumT > & | data, |
std::vector< int64_t > & | start, | ||
std::vector< int64_t > & | size | ||
) |
Insert an array as part of a data in the final file.
data | The array to put in the file. |
start | The starting index to insert the data. |
size | The size of the array to put in the file. |
NumT | numeric data type of data |
Definition at line 629 of file NeXusFile.cpp.
References putSlab().
void NeXus::File::putSlab | ( | std::vector< NumT > & | data, |
int | start, | ||
int | size | ||
) |
Insert a number as part of a data in the final file.
data | The array to put in the file. |
start | The starting index to insert the data. |
size | The size of the array to put in the file. |
NumT | numeric data type of data |
Definition at line 638 of file NeXusFile.cpp.
References putSlab().
void NeXus::File::putSlab | ( | std::vector< NumT > & | data, |
int64_t | start, | ||
int64_t | size | ||
) |
Insert a number as part of a data in the final file.
data | The array to put in the file. |
start | The starting index to insert the data. |
size | The size of the array to put in the file. |
NumT | numeric data type of data |
Definition at line 643 of file NeXusFile.cpp.
References putSlab().
void NeXus::File::readData | ( | const std::string & | dataName, |
std::vector< NumT > & | data | ||
) |
Put data into the supplied vector.
The vector does not need to be the correct size, just the correct type as it is resized to the appropriate value.
The named data object is opened, loaded, then closed.
dataName | :: name of the data to open. |
data | :: Where to put the data. |
NumT | numeric data type of data |
Definition at line 863 of file NeXusFile.cpp.
References closeData(), getData(), and openData().
void NeXus::File::readData | ( | const std::string & | dataName, |
NumT & | data | ||
) |
Put data into the supplied value.
The named data object is opened, loaded, then closed.
dataName | :: name of the data to open. |
data | :: Where to put the data. |
NumT | numeric data type of data |
Definition at line 871 of file NeXusFile.cpp.
References closeData(), getData(), and openData().
void NeXus::File::readData | ( | const std::string & | dataName, |
std::string & | data | ||
) |
Put data into the supplied string.
The vector does not need to be the correct size, just the correct type as it is resized to the appropriate value.
The named data object is opened, loaded, then closed.
dataName | :: name of the data to open. |
data | :: Where to put the data. |
Definition at line 881 of file NeXusFile.cpp.
References closeData(), getStrData(), and openData().
bool NeXus::File::sameID | ( | NXlink & | first, |
NXlink & | second | ||
) |
Determine whether or not two links refer to the same data or group.
first | The first link information to compare. |
second | The second link information to compare. |
Definition at line 1175 of file NeXusFile.cpp.
References NXsameID().
void NeXus::File::setNumberFormat | ( | NXnumtype & | type, |
const std::string & | format | ||
) |
Set the number format used for a particular type when using the xml base.
This is ignore in the other bases.
\param type The primitive type to set the format for. \param format The format to use.
Definition at line 1201 of file NeXusFile.cpp.
References NXsetnumberformat().
void NeXus::File::writeCompData | ( | const std::string & | name, |
const std::vector< NumT > & | value, | ||
const std::vector< int > & | dims, | ||
const NXcompression | comp, | ||
const std::vector< int > & | bufsize | ||
) |
(const std::string & name, (const std::string & name,
(const std::string & name, const std::vector<NumT> & value, const std::vector<int64_t> & dims, const NXcompression comp, const std::vector<int64_t> & bufsize) (const std::string & name, const std::vector<NumT> & value, const std::vector<int64_t> & dims, const NXcompression comp, const std::vector<int64_t> & bufsize)
Definition at line 482 of file NeXusFile.cpp.
void NeXus::File::writeCompData | ( | const std::string & | name, |
const std::vector< NumT > & | value, | ||
const std::vector< int64_t > & | dims, | ||
const NXcompression | comp, | ||
const std::vector< int64_t > & | bufsize | ||
) |
Create a compressed data, insert the data, and close it.
name | The name of the data to create. |
value | The vector to put into the file. |
dims | The dimensions of the data. |
comp | The compression algorithm to use. |
bufsize | The size of the compression buffer to use. |
NumT | numeric data type of value |
Definition at line 489 of file NeXusFile.cpp.
References closeData(), makeCompData(), and putData().
void NeXus::File::writeData | ( | const std::string & | name, |
const std::string & | value | ||
) |
Create a 1D data field, insert the data, and close the data.
name | The name of the field to create. |
value | The string to put into the file. |
Definition at line 339 of file NeXusFile.cpp.
References NeXus::CHAR, closeData(), makeData(), and putData().
Referenced by writeData(), and NeXus::Stream::DataHolder< NumT >::writeToFile().
void NeXus::File::writeData | ( | const std::string & | name, |
const char * | value | ||
) |
Create a 1D data field, insert the data, and close the data.
name | The name of the field to create. |
value | The string to put into the file. |
Definition at line 335 of file NeXusFile.cpp.
References writeData().
void NeXus::File::writeData | ( | const std::string & | name, |
const std::vector< NumT > & | value | ||
) |
Create a 1D data field, insert the data, and close the data.
NumT | numeric data type of value |
name | The name of the field to create. |
value | The vector to put into the file. |
Definition at line 357 of file NeXusFile.cpp.
References writeData().
void NeXus::File::writeData | ( | const std::string & | name, |
const NumT & | value | ||
) |
Create a 1D data field, insert the data, and close the data.
NumT | numeric data type of value |
name | The name of the field to create. |
value | The value to put into the file. |
Definition at line 330 of file NeXusFile.cpp.
References writeData().
void NeXus::File::writeData | ( | const std::string & | name, |
const std::vector< NumT > & | value, | ||
const std::vector< int > & | dims | ||
) |
Create a n-dimension data field, insert the data, and close the data.
name | The name of the field to create. |
value | The data to put into the file. |
dims | The dimensions of the data. |
NumT | numeric data type of value |
Definition at line 363 of file NeXusFile.cpp.
References closeData(), makeData(), and putData().
void NeXus::File::writeData | ( | const std::string & | name, |
const std::vector< NumT > & | value, | ||
const std::vector< int64_t > & | dims | ||
) |
Create a n-dimension data field, insert the data, and close the data.
name | The name of the field to create. |
value | The data to put into the file. |
dims | The dimensions of the data. |
NumT | numeric data type of value |
Definition at line 371 of file NeXusFile.cpp.
References closeData(), makeData(), and putData().
void NeXus::File::writeExtendibleData | ( | const std::string & | name, |
std::vector< NumT > & | value | ||
) |
Create a 1D data field with an unlimited dimension, insert the data, and close the data.
NumT | numeric data type of value |
name | :: The name of the field to create. |
value | :: The vector to put into the file. |
Definition at line 380 of file NeXusFile.cpp.
void NeXus::File::writeExtendibleData | ( | const std::string & | name, |
std::vector< NumT > & | value, | ||
const int64_t | chunk | ||
) |
Create a 1D data field with an unlimited dimension, insert the data, and close the data.
NumT | numeric data type of value |
name | :: The name of the field to create. |
value | :: The vector to put into the file. |
chunkSize | :: chunk size to use when writing |
Definition at line 387 of file NeXusFile.cpp.
References closeData(), makeCompData(), NeXus::NONE, and putSlab().
void NeXus::File::writeExtendibleData | ( | const std::string & | name, |
std::vector< NumT > & | value, | ||
std::vector< int64_t > & | dims, | ||
std::vector< int64_t > & | chunk | ||
) |
Create a 1D data field with an unlimited dimension, insert the data, and close the data.
NumT | numeric data type of value |
name | :: The name of the field to create. |
value | :: The vector to put into the file. |
dims | :: The dimensions of the data. |
chunk | :: chunk size to use when writing |
Definition at line 398 of file NeXusFile.cpp.
References closeData(), makeCompData(), NeXus::NONE, and putSlab().
void NeXus::File::writeUpdatedData | ( | const std::string & | name, |
std::vector< NumT > & | value | ||
) |
Updates the data written into an already-created data vector.
If the data was created as extendible, it will be resized.
\tparam NumT numeric data type of \a value \param name :: The name of the field to create. \param value :: The vector to put into the file.
Definition at line 415 of file NeXusFile.cpp.
References closeData(), openData(), and putSlab().
void NeXus::File::writeUpdatedData | ( | const std::string & | name, |
std::vector< NumT > & | value, | ||
std::vector< int64_t > & | dims | ||
) |
Updates the data written into an already-created data vector.
If the data was created as extendible, it will be resized.
\tparam NumT numeric data type of \a value \param name :: The name of the field to create. \param value :: The vector to put into the file. \param dims :: The dimensions of the data.
Definition at line 423 of file NeXusFile.cpp.
References closeData(), openData(), and putSlab().