Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class document

boost::document — This is the main class interface to be exposed to the library user.

Synopsis

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


class document {
public:
  // construct/copy/destruct
  explicit document(const boost::filesystem::path &);
  ~document();

  // private member functions
  std::shared_ptr< document_interface > init();

  // public member functions
  void create_document();
  void open_document();
  void close_document();
  void save_document();
  void save_as_document(const boost::filesystem::path &);
  void export_document(boost::document_file_format::type = boost::document_file_format::PDF);
  boost::sheet insert_sheet(const std::string &);
  boost::sheet get_sheet(const std::string &);
  boost::sheet operator[](const std::string &);
  boost::sheet get_sheet(std::size_t);
  boost::sheet operator[](std::size_t);
  void delete_sheet(const std::string &);
  void delete_sheet(std::size_t);
  std::size_t sheet_count() const;
};

Description

document public construct/copy/destruct

  1. explicit document(const boost::filesystem::path & path);
    The Constructor. Creates a new document object.
  2. ~document();
    Destructor Closes Unsaved Documents.

document private member functions

  1. std::shared_ptr< document_interface > init();

document public member functions

  1. void create_document();
    creates document using Calc/Excel given in the file path.
  2. void open_document();
    Opens document using Calc/Excel given in the file path.
  3. void close_document();
    Closes document using Calc/Excel given in the file path.
  4. void save_document();
    saves document using Calc/Excel given in the file path.
  5. void save_as_document(const boost::filesystem::path & path);
    saves document at the path using Calc/Excel provided in first argument.
  6. void export_document(boost::document_file_format::type format = boost::document_file_format::PDF);
    Exports document using Calc/Excel given in the file path and the file format. Default format is PDF.
  7. boost::sheet insert_sheet(const std::string & str);
    Inserts a sheet in the document and returns the sheet instance.
  8. boost::sheet get_sheet(const std::string & str);
    Gets a sheet instance of name str which can be manipulated as needed.
  9. boost::sheet operator[](const std::string & str);
  10. boost::sheet get_sheet(std::size_t index);
    Gets a sheet instance of that index which can be manipulated as needed.
  11. boost::sheet operator[](std::size_t index);
  12. void delete_sheet(const std::string & str);
    Deletes the sheet of name str.
  13. void delete_sheet(std::size_t index);
    Deletes the sheet of name str.
  14. std::size_t sheet_count() const;
    Gives you the number of sheets.

PrevUpHomeNext