NO FRAMES

Class IloCsvLine

Definition file: ilconcert/ilocsvreader.h
Represents a line in a csv file.

An instance of IloCsvLine represents a single line in a file of comma-separated values (csv file).

Constructor and Destructor Summary
public IloCsvLine()
public IloCsvLine(IloCsvLineI * impl)
public IloCsvLine(const IloCsvLine & csvLine)
Method Summary
public voidcopy(const IloCsvLine)
public IloBoolemptyFieldByHeader(const char * name) const
public IloBoolemptyFieldByPosition(IloInt i) const
public voidend()
public IloNumgetFloatByHeader(const char * name) const
public IloNumgetFloatByHeaderOrDefaultValue(const char * name, IloNum defaultValue) const
public IloNumgetFloatByPosition(IloInt i) const
public IloNumgetFloatByPositionOrDefaultValue(IloInt i, IloNum defaultValue) const
public IloCsvLineI *getImpl() const
public IloIntgetIntByHeader(const char * name) const
public IloIntgetIntByHeaderOrDefaultValue(const char * name, IloInt defaultValue) const
public IloIntgetIntByPosition(IloInt i) const
public IloIntgetIntByPositionOrDefaultValue(IloInt i, IloInt defaultValue) const
public IloIntgetLineNumber() const
public IloIntgetNumberOfFields() const
public char *getStringByHeader(const char * name) const
public char *getStringByHeaderOrDefaultValue(const char * name, const char * defaultValue) const
public char *getStringByPosition(IloInt i) const
public char *getStringByPositionOrDefaultValue(IloInt i, const char * defaultValue) const
public voidoperator=(const IloCsvLine & csvLine)
public IloBoolprintValueOfKeys() const
Constructor and Destructor Detail

IloCsvLine

public IloCsvLine()

This constructor creates a csv line object whose handle pointer is null. This object must be assigned before it can be used.


IloCsvLine

public IloCsvLine(IloCsvLineI * impl)

This constructor creates a handle object (an instance of IloCsvLine) from a pointer to an implementation object (an instance of the class IloCsvLineI).


IloCsvLine

public IloCsvLine(const IloCsvLine & csvLine)

This copy constructor creates a handle from a reference to a csv line object. The csv line object and csvLine both point to the same implementation object.


Method Detail

copy

public void copy(const IloCsvLine)

This member function returns the real number of the invoking csv line in the data file.


emptyFieldByHeader

public IloBool emptyFieldByHeader(const char * name) const

This member function returns IloTrue if the field denoted by the string name in the invoking csv line is empty. Otherwise, it returns IloFalse


emptyFieldByPosition

public IloBool emptyFieldByPosition(IloInt i) const

This member function returns IloTrue if the field denoted by i in the invoking csv line is empty. Otherwise, it returns IloFalse


end

public void end()

This member function deallocates the memory used by the csv line. If you no longer need a csv line, you can call this member function to reduce memory consumption.


getFloatByHeader

public IloNum getFloatByHeader(const char * name) const

This member function returns the float contained in the field name in the invoking csv line.

If you have a loop in which you are getting a string, integer, or float by header on several lines with the same header name, it is better for performance to get the position of the header named name using the member function IloCsvReader::getPosition(name) than using IloCsvLine::getFloatByPosition (position of name in the header line).


getFloatByHeaderOrDefaultValue

public IloNum getFloatByHeaderOrDefaultValue(const char * name, IloNum defaultValue) const

This member function returns the float contained in the field name in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getFloatByPosition

public IloNum getFloatByPosition(IloInt i) const

This member function returns the float contained in the field i in the invoking csv line.


getFloatByPositionOrDefaultValue

public IloNum getFloatByPositionOrDefaultValue(IloInt i, IloNum defaultValue) const

This member function returns the float contained in the field i in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getImpl

public IloCsvLineI * getImpl() const

This member function returns a pointer to the implementation object corresponding to the invoking csv line.


getIntByHeader

public IloInt getIntByHeader(const char * name) const

This member function returns the integer contained in the field name in the invoking csv line.

If you have a loop in which you are getting a string, integer, or float by header on several lines with the same header name, it is better for performance to get the position of the header named name using the member function IloCsvReader::getPosition(name) than using IloCsvLine::getIntByPosition (position of name in the header line).


getIntByHeaderOrDefaultValue

public IloInt getIntByHeaderOrDefaultValue(const char * name, IloInt defaultValue) const

This member function returns the integer contained in the field name in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getIntByPosition

public IloInt getIntByPosition(IloInt i) const

This member function returns the integer contained in the field i in the invoking csv line.


getIntByPositionOrDefaultValue

public IloInt getIntByPositionOrDefaultValue(IloInt i, IloInt defaultValue) const

This member function returns the integer contained in the field i in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getLineNumber

public IloInt getLineNumber() const

This member function returns the real number of the invoking csv line in the data file.


getNumberOfFields

public IloInt getNumberOfFields() const

This member function returns the number of fields in the line.


getStringByHeader

public char * getStringByHeader(const char * name) const

This member function returns a reference to the string contained in the field name in the invoking csv line.

If you have a loop in which you are getting a string, integer, or float by header on several lines with the same header name, it is better for performance to get the position of the header named name using the member function IloCsvReader::getPosition(name) than using IloCsvLine::getStringByPosition (position of name in the header line).


getStringByHeaderOrDefaultValue

public char * getStringByHeaderOrDefaultValue(const char * name, const char * defaultValue) const

This member function returns the string contained in the field name in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


getStringByPosition

public char * getStringByPosition(IloInt i) const

This member function returns a reference to the string contained in the field number i in the invoking csv line.


getStringByPositionOrDefaultValue

public char * getStringByPositionOrDefaultValue(IloInt i, const char * defaultValue) const

This member function returns the string contained in the field i in the invoking csv line if this field contains a value. Otherwise, it returns defaultValue.


operator=

public void operator=(const IloCsvLine & csvLine)

This operator assigns an address to the handle pointer of the invoking csv line. This address is the location of the implementation object of the argument csvLine.

After execution of this operator, the invoking csv line and csvLine both point to the same implementation object.


printValueOfKeys

public IloBool printValueOfKeys() const

This member function prints the values of the keys fields in this line.