From: <prn...@us...> - 2012-03-18 12:59:07
|
Revision: 9943 http://octave.svn.sourceforge.net/octave/?rev=9943&view=rev Author: prnienhuis Date: 2012-03-18 12:59:01 +0000 (Sun, 18 Mar 2012) Log Message: ----------- Fixed texinfo headers, improved clarity of error messages Modified Paths: -------------- trunk/octave-forge/main/io/src/cell2csv.cc trunk/octave-forge/main/io/src/csv2cell.cc trunk/octave-forge/main/io/src/csvconcat.cc trunk/octave-forge/main/io/src/csvexplode.cc trunk/octave-forge/main/io/src/xmltree.c Modified: trunk/octave-forge/main/io/src/cell2csv.cc =================================================================== --- trunk/octave-forge/main/io/src/cell2csv.cc 2012-03-18 12:58:03 UTC (rev 9942) +++ trunk/octave-forge/main/io/src/cell2csv.cc 2012-03-18 12:59:01 UTC (rev 9943) @@ -24,11 +24,11 @@ "@deftypefnx {Loadable Function} {} cell2csv (@var{file}, @var{c}, @var{sep})\n" "@deftypefnx {Loadable Function} {} cell2csv (@var{file}, @var{c}, @var{sep}, @var{prot})\n" "\n" - "Create a CSV file from a cell. " - "@var{sep} changes the character used to separate two fields. By " - "default, two fields are expected to be separated by a coma " - "(@code{,}). @var{prot} changes the character used to protect a string. " - "By default it's a double quote (@code{\"}).\n" + "Create a CSV file from a cell array. " + "@var{sep} (character value) changes the character used to separate two fields. " + "The default value is a comma " + "(@code{,}). @var{prot} (character value) changes the character used to protect a string. " + "Default value is a double quote (@code{\"}).\n" "@end deftypefn") { /* Check argument */ @@ -44,20 +44,20 @@ std::string sep = (args.length() > 2) ? args(2).string_value() : ","; if (sep.length() != 1) { - error("Only on charactere need as separator\n"); + error("cell2csv: separator can only be one character\n"); return octave_value(); } std::string prot = (args.length() > 3) ? args(3).string_value() : "\""; if (prot.length() != 1) { - error("Only on charactere need as protector\n"); + error("cell2csv: protector can only be one character\n"); return octave_value(); } /* Open file */ std::ofstream fd(file.c_str()); if (!fd.is_open()) { - error("cannot write %s\n", file.c_str()); + error("cell2csv: cannot open file %s for writing\n", file.c_str()); return octave_value(); } @@ -98,7 +98,7 @@ else if (!c(i, j).is_empty()) { /* Output NaN value */ - warning ("not a real or a string\n"); + warning ("cell2csv: empty cell or not a real or a string value - converted to 'NaN'\n"); word += "NaN"; } Modified: trunk/octave-forge/main/io/src/csv2cell.cc =================================================================== --- trunk/octave-forge/main/io/src/csv2cell.cc 2012-03-18 12:58:03 UTC (rev 9942) +++ trunk/octave-forge/main/io/src/csv2cell.cc 2012-03-18 12:59:01 UTC (rev 9943) @@ -28,10 +28,11 @@ "\n" "Read a CSV (Comma Separated Values) file and convert it into a " "cell. " - "@var{sep} changes the character used to separate two fields. By " - "default, two fields are expected to be separated by a coma " - "(@code{,}). @var{prot} changes the character used to protect a string. " - "By default it's a double quote (@code{\"}).\n" + "@var{sep} (a character value) changes the character used to separate two fields. " + "The default value is a comma " + "(@code{,}). @var{prot} (character value) changes the character used to protect a string. " + "The default is a double quote (@code{\"}).\n" + "The maximum line width of the csv file is 4092 characters.\n" "@end deftypefn") { /* Get arguments */ @@ -48,7 +49,7 @@ const std::string _sep = (nargin > 1) ? args (1).string_value () : ","; if (_sep.length() != 1) { - error ("csv2cell: only on charactere need as separator"); + error ("csv2cell: separator value can only be one character\n"); return retval; } char sep = _sep[0]; @@ -56,7 +57,7 @@ const std::string _prot = (nargin > 2) ? args (2).string_value () : "\""; if (_prot.length() != 1) { - error ("csv2cell: only on charactere need as protector"); + error ("csv2cell: protector value can be only one character\n"); return retval; } char prot = _prot[0]; @@ -65,7 +66,7 @@ std::ifstream fd (file.c_str ()); if (!fd.is_open ()) { - error ("csv2cell: cannot read %s", file.c_str()); + error ("csv2cell: cannot open file %s for reading\n", file.c_str()); return retval; } fd.seekg (0, std::ios::end); @@ -118,7 +119,7 @@ fd.seekg (0, std::ios::beg); if (!fd.good ()) { - error ("csv2cell: cannot reread %s", file.c_str ()); + error ("csv2cell: cannot reread %s\n", file.c_str ()); return retval; } @@ -149,7 +150,7 @@ if (j == nbcolumns) { fd.close (); - error ("csv2cell: incorrect CSV file, line %d too long", i+1); + error ("csv2cell: incorrect CSV file, line %d too long\n", i+1); return retval; } @@ -180,7 +181,7 @@ if (j != nbcolumns) { fd.close (); - error ("csv2cell: incorrect CSV file, line %d too short", i+1); + error ("csv2cell: incorrect CSV file, line %d too short\n", i+1); return retval; } } Modified: trunk/octave-forge/main/io/src/csvconcat.cc =================================================================== --- trunk/octave-forge/main/io/src/csvconcat.cc 2012-03-18 12:58:03 UTC (rev 9942) +++ trunk/octave-forge/main/io/src/csvconcat.cc 2012-03-18 12:59:01 UTC (rev 9943) @@ -23,10 +23,10 @@ "@deftypefnx {Loadable Function} {@var{str} = } csvconcat (@var{c}, @var{sep}, @var{prot})\n" "\n" "Concatenate a cell into a CSV string or array of strings. " - "@var{sep} changes the character used to separate two fields. By " - "default, two fields are expected to be separated by a coma " - "(@code{,}). @var{prot} changes the character used to protect a string. " - "By default it's a double quote (@code{\"}).\n" + "@var{sep} (character value) changes the character used to separate two fields. " + "The default value is a comma " + "(@code{,}). @var{prot} (character value) changes the character used to protect a string. " + "The default is a double quote (@code{\"}).\n" "@end deftypefn") { /* Check argument */ @@ -40,13 +40,13 @@ std::string sep = (args.length() > 1) ? args(1).string_value() : ","; if (sep.length() != 1) { - error("Only on charactere need as separator\n"); + error("csvconcat: separator can only be one character\n"); return octave_value(); } std::string prot = (args.length() > 2) ? args(2).string_value() : "\""; if (prot.length() != 1) { - error("Only on charactere need as protector\n"); + error("csvconcat: protector can only be one character\n"); return octave_value(); } @@ -87,7 +87,7 @@ else { /* Output NaN value */ - warning ("not a real or a string\n"); + warning ("csvconcat: empty cell or not a real or string value - converted to 'NaN'\n"); word += "NaN"; } } Modified: trunk/octave-forge/main/io/src/csvexplode.cc =================================================================== --- trunk/octave-forge/main/io/src/csvexplode.cc 2012-03-18 12:58:03 UTC (rev 9942) +++ trunk/octave-forge/main/io/src/csvexplode.cc 2012-03-18 12:59:01 UTC (rev 9943) @@ -23,10 +23,9 @@ "@deftypefnx {Loadable Function} {@var{c} = } csvexplode (@var{str}, @var{sep}, @var{prot})\n" "\n" "Explode a CSV string into a cell. " - "@var{sep} changes the character used to separate two fields. By " - "default, two fields are expected to be separated by a coma " - "(@code{,}). @var{prot} changes the character used to protect a string. " - "By default it's a double quote (@code{\"}).\n" + "@var{sep} (character value) changes the character used to separate two fields. " + "The default value is a comma (@code{,}). @var{prot} (character value) changes " + "the character used to protect a string. The default is a double quote (@code{\"}).\n" "@end deftypefn") { /* Check argument */ @@ -46,14 +45,14 @@ std::string _sep = (args.length() > 1) ? args(1).string_value() : ","; if (_sep.length() != 1) { - error("Only on charactere need as separator\n"); + error("csvexplode: separator can only be one character\n"); return octave_value(); } char sep = _sep[0]; std::string _prot = (args.length() > 2) ? args(2).string_value() : "\""; if (_prot.length() != 1) { - error("Only on charactere need as protector\n"); + error("csvexplode: protector can only be one character\n"); return octave_value(); } char prot = _prot[0]; Modified: trunk/octave-forge/main/io/src/xmltree.c =================================================================== --- trunk/octave-forge/main/io/src/xmltree.c 2012-03-18 12:58:03 UTC (rev 9942) +++ trunk/octave-forge/main/io/src/xmltree.c 2012-03-18 12:59:01 UTC (rev 9943) @@ -23,7 +23,7 @@ element *new; new = (element *) malloc (sizeof(element)); if (!new) - perror("xml: no enough memory for new_element()\n"); + perror("xmltree: not enough memory for new_element()\n"); new->next = new->child = NULL; @@ -152,7 +152,7 @@ list *new; new = (list *) malloc (sizeof(list)); if (!new) - perror("xml: no enough memory for new_list()\n"); + perror("xmltree: not enough memory for new_list()\n"); new->prev = father; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |