Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class cell

boost::cell

Synopsis

// In header: <boost/document/cell.hpp>


class cell {
public:
  // construct/copy/destruct
  explicit cell(const std::shared_ptr< cell_interface >);
  cell(const cell &);
  cell & operator=(const cell &);
  cell & operator=(const std::string &);
  cell & operator=(double);
  ~cell();

  // public member functions
  void set_formula(const std::string &);
  void set_string(const std::string &);
  void set_value(double);
  void reset();
  std::string get_formula() const;
  std::string get_string() const;
  double get_value() const;
  std::size_t get_row_index() const;
  std::size_t get_column_index() const;
  bool empty() const;
  boost::cell_content_type::type get_content_type() const;
  bool operator<(const std::string &);
  bool operator>(const std::string &);
  bool operator==(const std::string &);
  bool operator==(const cell &);
};

Description

cell public construct/copy/destruct

  1. explicit cell(const std::shared_ptr< cell_interface > impl);

    The default constructor which takes in the corresponding cell_interface for operation. Follows the pimpl idiom to support MS and LibreOffice.

  2. cell(const cell & c);
    The copy constructor of the cell.
  3. cell & operator=(const cell & c);
    The assignment operator of the cell class. Makes all operations non shallow with respect to the internal cells.
  4. cell & operator=(const std::string & str);
    The overloaded = operator sets a string in the cell.
  5. cell & operator=(double x);
    The overloaded = operator sets a double in the cell.
  6. ~cell();
    Default Destructor. Does nothing.

cell public member functions

  1. void set_formula(const std::string & s);
    Sets a formula in the cell.
  2. void set_string(const std::string & str);
    Sets a string in the cell.
  3. void set_value(double x);
    Sets a double in the cell.
  4. void reset();
    Resets the contents of the cell.
  5. std::string get_formula() const;
    Gets the formula in the cell.
  6. std::string get_string() const;
    Gets the string present in the cell.
  7. double get_value() const;
    Gets the value present in the cell.
  8. std::size_t get_row_index() const;
    Gets the row index of the cell.
  9. std::size_t get_column_index() const;
    Gets the column index of the cell.
  10. bool empty() const;
    Returns whether the cell is empty or not as a boolean.
  11. boost::cell_content_type::type get_content_type() const;
    Given the cell content, returns the type of cell content currently present in it in the. form of boost::cell_content_type::type enum which can be of the following values, EMPTY,STRING,VALUE,FORMULA,ERROR.
  12. bool operator<(const std::string & str);
    Compares the cell with a string assuming that the cell contains a string.
  13. bool operator>(const std::string & str);
    Compares the cell with a string assuming that the cell contains a string.
  14. bool operator==(const std::string & str);
    Compares the cell with a string assuming that the cell contains a string.
  15. bool operator==(const cell & c);
    Compares the cell with another cell.

PrevUpHomeNext