Mercurial > octave
diff libinterp/corefcn/help.cc @ 27101:097774bed4ed
move some static functions inside octave namespace
In most files that define static functions and use the octave
namespace, define the static fucntions inside the namespace.
Files affected: octave-qscintilla.cc, main-window.cc,
variable-editor-model.cc, variable-editor.cc, welcome-wizard.cc,
call-stack.cc, environment.cc, help.cc, input.cc, load-path.cc,
sysdep.cc, text-renderer.cc, url-handle-manager.cc, __ode15__.cc,
ov-typeinfo.cc, aepbalance.cc, chol.cc, gsvd.cc, file-ops.cc,
lo-array-errwarn.cc, lo-regexp.cc, oct-glob.cc, and oct-sparse.cc.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 21 May 2019 19:50:59 +0000 |
parents | 8408acb7ca4f |
children | 84ff9953faa1 |
line wrap: on
line diff
--- a/libinterp/corefcn/help.cc Tue May 21 17:39:13 2019 +0000 +++ b/libinterp/corefcn/help.cc Tue May 21 19:50:59 2019 +0000 @@ -72,86 +72,86 @@ #include "default-defs.h" -const static char * const operators[] = -{ - "!", - "~", - "!=", - "~=", - R"(")", - "#", - "%", - "#{", - "%{", - "#}", - "%}", - "...", - "&", - "&&", - "'", - "(", - ")", - "*", - "**", - "^", - "+", - "++", - ",", - "-", - "--", - ".'", - ".*", - ".**", - ".^", - "./", - "/", - R"(.\)", - R"(\)", - ":", - ";", - "<", - "<=", - "=", - "==", - ">", - ">=", - "[", - "]", - "|", - "||", - nullptr -}; - -const static string_vector operator_names (operators); - -static bool -looks_like_html (const std::string& msg) -{ - const size_t p1 = msg.find ('\n'); - std::string t = msg.substr (0, p1); - // FIXME: this comparison should be case-insensitive - const size_t p2 = t.find ("<html"); - - return (p2 != std::string::npos); -} - -static bool -looks_like_texinfo (const std::string& msg, size_t& p1) -{ - p1 = msg.find ('\n'); - - std::string t = msg.substr (0, p1); - - if (p1 == std::string::npos) - p1 = 0; - - size_t p2 = t.find ("-*- texinfo -*-"); - - return (p2 != std::string::npos); -} - namespace octave { + const static char * const operators[] = + { + "!", + "~", + "!=", + "~=", + R"(")", + "#", + "%", + "#{", + "%{", + "#}", + "%}", + "...", + "&", + "&&", + "'", + "(", + ")", + "*", + "**", + "^", + "+", + "++", + ",", + "-", + "--", + ".'", + ".*", + ".**", + ".^", + "./", + "/", + R"(.\)", + R"(\)", + ":", + ";", + "<", + "<=", + "=", + "==", + ">", + ">=", + "[", + "]", + "|", + "||", + nullptr + }; + + const static string_vector operator_names (operators); + + static bool + looks_like_html (const std::string& msg) + { + const size_t p1 = msg.find ('\n'); + std::string t = msg.substr (0, p1); + // FIXME: this comparison should be case-insensitive + const size_t p2 = t.find ("<html"); + + return (p2 != std::string::npos); + } + + static bool + looks_like_texinfo (const std::string& msg, size_t& p1) + { + p1 = msg.find ('\n'); + + std::string t = msg.substr (0, p1); + + if (p1 == std::string::npos) + p1 = 0; + + size_t p2 = t.find ("-*- texinfo -*-"); + + return (p2 != std::string::npos); + } + octave_value help_system::built_in_docstrings_file (const octave_value_list& args, int nargout) @@ -766,7 +766,7 @@ Undocumented internal function. @end deftypefn */) { - return ovl (Cell (operator_names)); + return ovl (Cell (octave::operator_names)); } // Return a cell array of strings containing the names of all keywords.