OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLComment Class Reference

An encapsulation of a comment element. More...

#include <XLComments.hpp>

Public Member Functions

 XLComment ()=delete
 
 XLComment (XMLNode node)
 Constructor. New items should only be created through an XLComments object.
 
 XLComment (const XLComment &other)=default
 Copy Constructor.
 
 XLComment (XLComment &&other) noexcept=default
 Move Constructor.
 
 ~XLComment ()=default
 
XLCommentoperator= (const XLComment &other)=default
 Copy assignment operator.
 
XLCommentoperator= (XLComment &&other) noexcept=default
 Move assignment operator.
 
bool valid () const
 Test if XLComment is linked to valid XML.
 
std::string ref () const
 
std::string text () const
 
XLRichText richText () const
 
uint16_t authorId () const
 
XLCommentsetText (const std::string &newText)
 
XLCommentsetRichText (const XLRichText &richText)
 
XLCommentsetAuthorId (uint16_t newAuthorId)
 

Detailed Description

An encapsulation of a comment element.

Constructor & Destructor Documentation

◆ XLComment() [1/4]

OpenXLSX::XLComment::XLComment ( )
delete

◆ XLComment() [2/4]

XLComment::XLComment ( XMLNode  node)
explicit

Constructor. New items should only be created through an XLComments object.

Parameters
nodeAn XMLNode object with the comment XMLNode. If no input is provided, a null node is used.

◆ XLComment() [3/4]

OpenXLSX::XLComment::XLComment ( const XLComment other)
default

Copy Constructor.

Parameters
otherObject to be copied.

◆ XLComment() [4/4]

OpenXLSX::XLComment::XLComment ( XLComment &&  other)
defaultnoexcept

Move Constructor.

Parameters
otherObject to be moved.

◆ ~XLComment()

OpenXLSX::XLComment::~XLComment ( )
default

Member Function Documentation

◆ authorId()

uint16_t XLComment::authorId ( ) const

◆ operator=() [1/2]

XLComment & OpenXLSX::XLComment::operator= ( const XLComment other)
default

Copy assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to the lhs object.

◆ operator=() [2/2]

XLComment & OpenXLSX::XLComment::operator= ( XLComment &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherRight hand side of assignment operation.
Returns
A reference to lhs object.

◆ ref()

std::string XLComment::ref ( ) const

◆ richText()

XLRichText XLComment::richText ( ) const

◆ setAuthorId()

XLComment & XLComment::setAuthorId ( uint16_t  newAuthorId)

◆ setRichText()

XLComment & XLComment::setRichText ( const XLRichText richText)

◆ setText()

XLComment & XLComment::setText ( const std::string &  newText)

◆ text()

std::string XLComment::text ( ) const

◆ valid()

bool XLComment::valid ( ) const

Test if XLComment is linked to valid XML.

Returns
true if comment was constructed on a valid XML node, otherwise false
Note
Function body moved to cpp module as it uses "not" keyword for readability, which MSVC sabotages with non-CPP compatibility.
For the library it is reasonable to expect users to compile it with MSCV /permissive- flag, but for the user's own projects the header files shall "just work"

The documentation for this class was generated from the following files: