From: jerome l. <jle...@us...> - 2003-04-27 22:35:46
|
Update of /cvsroot/xlw/xlw/xlw In directory sc8-pr-cvs1:/tmp/cvs-serv10959 Modified Files: XlfOper.h XlfOper.inl Log Message: added direct support for std::string when constructing XlfOper objects Index: XlfOper.h =================================================================== RCS file: /cvsroot/xlw/xlw/xlw/XlfOper.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** XlfOper.h 22 Apr 2003 12:41:07 -0000 1.16 --- XlfOper.h 27 Apr 2003 22:35:42 -0000 1.17 *************** *** 25,31 **** #include <xlw/EXCEL32_API.h> #include <xlw/xlcall32.h> #include <xlw/XlfExcel.h> - #include <vector> #if defined(_MSC_VER) --- 25,32 ---- #include <xlw/EXCEL32_API.h> + #include <vector> + #include <string> #include <xlw/xlcall32.h> #include <xlw/XlfExcel.h> #if defined(_MSC_VER) *************** *** 68,71 **** --- 69,74 ---- //! 0 terminated chararcter string ctor. XlfOper(const char *value); + //! std::string ctor. + XlfOper(const std::string& str); //! XlfRef ctor. XlfOper(const XlfRef& range); *************** *** 140,151 **** //! Set the underlying XLOPER * to lpxloper XlfOper& Set(LPXLOPER lpxloper); ! //! Set to a a double XlfOper& Set(double value); ! //! Set to a a short XlfOper& Set(short value); ! //! Set to a a boolean XlfOper& Set(bool value); ! //! Set to a a zero-terminated character string XlfOper& Set(const char *value); //! Set to a range XlfOper& Set(const XlfRef& range); --- 143,156 ---- //! Set the underlying XLOPER * to lpxloper XlfOper& Set(LPXLOPER lpxloper); ! //! Set to a double XlfOper& Set(double value); ! //! Set to a short XlfOper& Set(short value); ! //! Set to a boolean XlfOper& Set(bool value); ! //! Set to a zero-terminated character string XlfOper& Set(const char *value); + //! Set to a standard string + XlfOper& Set(const std::string& value); //! Set to a range XlfOper& Set(const XlfRef& range); Index: XlfOper.inl =================================================================== RCS file: /cvsroot/xlw/xlw/xlw/XlfOper.inl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** XlfOper.inl 22 Apr 2003 12:41:07 -0000 1.6 --- XlfOper.inl 27 Apr 2003 22:35:43 -0000 1.7 *************** *** 68,71 **** --- 68,80 ---- /*! + See XlfOper::Set(const std::string&) + */ + INLINE XlfOper::XlfOper(const std::string& value) + { + Allocate(); + Set(value); + } + + /*! See XlfOper::Set(const char *) */ *************** *** 85,88 **** --- 94,105 ---- Allocate(); Set(range); + } + + /*! + Provided for convenience. Forwards to XlfOper::Set(const char *) + */ + INLINE XlfOper& XlfOper::Set(const std::string& val) + { + return Set(val.c_str()); } |