Update of /cvsroot/objecthandler/ObjectHandler/gensrc/stubs
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18949/gensrc/stubs
Modified Files:
stub.excel.includes stub.excel.register stub.excel.unregister
Log Message:
allow user to specify delimiter for ohParseField()
Index: stub.excel.register
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.register,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** stub.excel.register 3 Jul 2006 08:19:26 -0000 1.4
--- stub.excel.register 12 Jul 2006 14:02:22 -0000 1.5
***************
*** 17,25 ****
TempStrNoSize("\x1D""range of cells to be packed ")); // description of parameter 1
! Excel(xlfRegister, 0, 13, &xDll,
TempStrNoSize("\x0C""ohParseField"), // function code name
! TempStrNoSize("\x05""RCNC#"), // parameter codes
TempStrNoSize("\x0C""ohParseField"), // function display name
! TempStrNoSize("\x0F""line,index,type"), // comma-delimited list of parameter names
TempStrNoSize("\x01""1"), // function type (1 = worksheet function)
TempStrNoSize("\x0D""ObjectHandler"), // function category
--- 17,25 ----
TempStrNoSize("\x1D""range of cells to be packed ")); // description of parameter 1
! Excel(xlfRegister, 0, 14, &xDll,
TempStrNoSize("\x0C""ohParseField"), // function code name
! TempStrNoSize("\x06""RCNCP#"), // parameter codes
TempStrNoSize("\x0C""ohParseField"), // function display name
! TempStrNoSize("\x19""line,index,type,delimiter"), // comma-delimited list of parameter names
TempStrNoSize("\x01""1"), // function type (1 = worksheet function)
TempStrNoSize("\x0D""ObjectHandler"), // function category
***************
*** 29,33 ****
TempStrNoSize("\x11""text to be parsed"), // description of parameter 1
TempStrNoSize("\x20""index (1-based) of desired field"), // description of parameter 2
! TempStrNoSize("\x23""required datatype (string/number) ")); // description of parameter 3
}
--- 29,34 ----
TempStrNoSize("\x11""text to be parsed"), // description of parameter 1
TempStrNoSize("\x20""index (1-based) of desired field"), // description of parameter 2
! TempStrNoSize("\x21""required datatype (string/number)"), // description of parameter 3
! TempStrNoSize("\x29""field delimiter (default is whitespace) ")); // description of parameter 3
}
Index: stub.excel.unregister
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.unregister,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** stub.excel.unregister 3 Jul 2006 08:19:26 -0000 1.4
--- stub.excel.unregister 12 Jul 2006 14:02:22 -0000 1.5
***************
*** 26,34 ****
Excel4(xlfUnregister, 0, 1, &xlRegID);
! Excel(xlfRegister, 0, 13, &xDll,
TempStrNoSize("\x0C""ohParseField"), // function code name
! TempStrNoSize("\x05""RCNC#"), // parameter codes
TempStrNoSize("\x0C""ohParseField"), // function display name
! TempStrNoSize("\x0F""line,index,type"), // comma-delimited list of parameter names
TempStrNoSize("\x01""0"), // function type (0 = hidden function)
TempStrNoSize("\x0D""ObjectHandler"), // function category
--- 26,34 ----
Excel4(xlfUnregister, 0, 1, &xlRegID);
! Excel(xlfRegister, 0, 14, &xDll,
TempStrNoSize("\x0C""ohParseField"), // function code name
! TempStrNoSize("\x06""RCNCP#"), // parameter codes
TempStrNoSize("\x0C""ohParseField"), // function display name
! TempStrNoSize("\x19""line,index,type,delimiter"), // comma-delimited list of parameter names
TempStrNoSize("\x01""0"), // function type (0 = hidden function)
TempStrNoSize("\x0D""ObjectHandler"), // function category
***************
*** 38,42 ****
TempStrNoSize("\x11""text to be parsed"), // description of parameter 1
TempStrNoSize("\x20""index (1-based) of desired field"), // description of parameter 2
! TempStrNoSize("\x23""required datatype (string/number) ")); // description of parameter 3
Excel4(xlfRegisterId, &xlRegID, 2, &xDll,
--- 38,43 ----
TempStrNoSize("\x11""text to be parsed"), // description of parameter 1
TempStrNoSize("\x20""index (1-based) of desired field"), // description of parameter 2
! TempStrNoSize("\x21""required datatype (string/number)"), // description of parameter 3
! TempStrNoSize("\x29""field delimiter (default is whitespace) ")); // description of parameter 3
Excel4(xlfRegisterId, &xlRegID, 2, &xDll,
Index: stub.excel.includes
===================================================================
RCS file: /cvsroot/objecthandler/ObjectHandler/gensrc/stubs/stub.excel.includes,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** stub.excel.includes 3 Jul 2006 08:19:26 -0000 1.4
--- stub.excel.includes 12 Jul 2006 14:02:22 -0000 1.5
***************
*** 107,111 ****
char *line,
long *index,
! char *type) {
boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
--- 107,112 ----
char *line,
long *index,
! char *type,
! OPER *delim) {
boost::shared_ptr < ObjHandler::FunctionCall > functionCall;
try {
***************
*** 121,124 ****
--- 122,128 ----
// invoke the utility function
+ std::string delimStr;
+ ObjHandler::operToScalar(delimStr, *delim, "[:space:]");
+
if (*index<1) {
std::stringstream msg;
***************
*** 128,132 ****
}
unsigned int i = static_cast<unsigned int>(*index);
! std::vector<std::string> fields = ObjHandler::split(line, i);
if (i>fields.size()) {
std::stringstream msg;
--- 132,138 ----
}
unsigned int i = static_cast<unsigned int>(*index);
!
! std::vector<std::string> fields = ObjHandler::split(line, i, delimStr);
!
if (i>fields.size()) {
std::stringstream msg;
|