/usr/include/ncAtt.h is in libnetcdf-c++4-dev 4.3.0+ds-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | #include "ncType.h"
#include "ncException.h"
#include <string>
#include <typeinfo>
#ifndef NcAttClass
#define NcAttClass
namespace netCDF
{
/*! Abstract base class represents inherited by ncVarAtt and ncGroupAtt. */
class NcAtt
{
public:
/*! destructor */
virtual ~NcAtt()=0;
/*! Constructor generates a \ref isNull "null object". */
NcAtt ();
/*! Constructor for non-null instances. */
NcAtt(bool nullObject);
/*! The copy constructor. */
NcAtt(const NcAtt& rhs);
/*! Get the attribute name. */
std::string getName() const {return myName;}
/*! Gets attribute length. */
size_t getAttLength() const;
/*! Returns the attribute type. */
NcType getType() const;
/*! Gets parent group. */
NcGroup getParentGroup() const;
/*! equivalence operator */
bool operator== (const NcAtt& rhs) const;
/*! != operator */
bool operator!=(const NcAtt& rhs) const;
/*! \overload
*/
void getValues(char* dataValues) const;
/*! \overload
*/
void getValues(unsigned char* dataValues) const;
/*! \overload
*/
void getValues(signed char* dataValues) const;
/*! \overload
*/
void getValues(short* dataValues) const;
/*! \overload
*/
void getValues(int* dataValues) const;
/*! \overload
*/
void getValues(long* dataValues) const;
/*! \overload
*/
void getValues(float* dataValues) const;
/*! \overload
*/
void getValues(double* dataValues) const;
/*! \overload
*/
void getValues(unsigned short* dataValues) const;
/*! \overload
*/
void getValues(unsigned int* dataValues) const;
/*! \overload
*/
void getValues(long long* dataValues) const;
/*! \overload
*/
void getValues(unsigned long long* dataValues) const;
/*! \overload
*/
void getValues(char** dataValues) const;
/*! \overload
(The string variable does not need preallocating.)
*/
void getValues(std::string& dataValues) const;
/*!
Gets a netCDF attribute.
The user must ensure that the variable "dataValues" has sufficient space to hold the attribute.
\param dataValues On return contains the value of the attribute.
If the type of data values differs from the netCDF variable type, type conversion will occur.
(However, no type conversion is carried out for variables using the user-defined data types:
nc_Vlen, nc_Opaque, nc_Compound and nc_Enum.)
*/
void getValues(void* dataValues) const;
/*! Returns true if this object is null (i.e. it has no contents); otherwise returns false. */
bool isNull() const {return nullObject;}
protected:
/*! assignment operator */
NcAtt& operator= (const NcAtt& rhs);
bool nullObject;
std::string myName;
int groupId;
int varId;
};
}
#endif
|