HumdrumRecord class public functions

HumdrumRecord
~HumdrumRecord
appendField
bibRecordQ
changeField
dataQ
equalFieldsQ
getExInterp
getExInterpNum
getFieldCount
getLine
getSpineID
getToken
getTokenCount
getType
globalCommentQ
hasExclusiveQ
hasPathQ
insertField
interpretationQ
localCommentQ
measureQ
nullQ
operator=
operator[]
setExInterp
setSpineID

HumdrumRecord(void);
Creates an empty record, equivalent to the string "".

HumdrumRecord(const char* aLine);
Copies the value of aLine and parses any spine components of the line.

HumdrumRecord(const HumdrumRecord& aRecord);
Copies the contents of aRecord.

~HumdrumRecord();
Clears all dynamically allocated memory in the object.

void appendField(int index, const char* aField, int anInterp = E_unknown, char* spinetrace = "");
Adds the given spine field to the end of the line, with the specified interpretation value and spine trace.

void appendField(int index, const char* aField, const char* anInterp = "**unknown", char* spinetrace = "");
Adds the given spine field to the end of the data line, with the specified interpretation string and spine trace.

void changeField(int index, const char* aString);
Removes the old contents of the spine at position index and replaces it with the value aString. The exclusive interpretation and spine ID remains the same. aString cannot contain any tab characters.

int equalFieldsQ(void);
Returns true if record is a data record or local comment record and all spines contain the same information.

int equalFieldsQ(int anInterp);
Returns true if all data records or local comment records of the given exclusive interpretation enumeration are equal.

int equalFieldsQ(const char* anInterp);
Returns true if all data records or local comment records of the given exclusive interpretation enumeration are equal. For example, equalFieldsQ("**kern") will return true if all spines containing kern data are equivalent to each other.

int equalFieldsQ(int anInterp, const char* compareString);
Returns true if the specified exclusive interpretation enumeration spines are all equivalent to compareString.

int equalFieldsQ(const char* anInterp, const char* compareString);
Returns true if spines with the specified exclusive interpretation are all equivalent to compareString.

int getExInterpNum(int index) const;
Returns the exclusive interpretation enumeration for the specified field index.

const char* getExInterp(int fieldIndex) const;
Returns the exclusive interpretation string for the specified field index.

int getFieldCount(void) const;
Returns how many spines are in the data record. If the record is not a data or local comment record, then 0 is returned.

const char* getLine(void);
Returns the complete record as a string.

const char* getSpineID(int index);
Returns the spine trace ID for the given spine. Returns "0" if record is not a data, interpretation, or local comment record.

int getTokenCount(int index, char separator = ' ');
Returns how many subtokens are present in the specified spine. Returns 0 if the record is not a data or local comment record. Will return 1 if the record is a local comment.

char* getToken(char* buffer, int fieldIndex, int tokenIndex, int buffersize = 0);
Extracts the specified subtoken in the given spine. If buffersize is positive, then makes sure that buffer is not filled with more than buffersize - 1 nonzero characters. The address of buffer is returned.

int getType(void);
Returns the record type enumeration for the line.

Functions related to getType():
void insertField(int index, const char* aField, int anInterp = E_unknown, char* spinetrace = "");
Adds the given spine field to the data line at the given index location, with the specified interpretation value and spine trace.

HumdrumRecord& operator=(const HumdrumRecord& aRecord);
Enables copying data between HumdrumRecord objects.

HumdrumRecord& operator=(const HumdrumRecord* aRecord);
Enables copying data from HumdrumRecord pointers.

HumdrumRecord& operator=(const char* aRecord);
Enables the assignment operator to create a HumdrumRecord from a text string.

const char* operator[](int index) const;
Returns the specified spine. Invalid to use with any data type except data and local comments.

const char* setExInterp(int index, const char* anInterp);
Sets the exclusive interpretation for the given spine. It is an error to give spine IDs to null records or global comments.

const char* setExInterp(int index, int anInterpNum);
Sets the exclusive interpretation enumeration for the given spine. It is an error to give spine IDs to null records or global comments.

const char* setSpineID(int index, const char* anID);
Sets the spine ID for the given spine. It is an error to give spine IDs to null records or global comments.