This file is indexed.

/usr/share/qt5/doc/qtscript/qscriptengine-obsolete.html is in qtscript5-doc-html 5.2.1+dfsg-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qscriptengine.cpp -->
  <title>Obsolete Members for QScriptEngine | QtScript </title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li>Qt 5.2</li>
<li><a href="qtscript-index.html">Qt Script</a></li>
<li><a href="qtscript-module.html">C++ Classes</a></li>
<li>QScriptEngine</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<h1 class="title">Obsolete Members for QScriptEngine</h1>
<p><b>The following members of class <a href="qscriptengine.html">QScriptEngine</a> are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qscriptengine-obsolete.html#canEvaluate">canEvaluate</a></b>(const QString &amp;<i> program</i>) const<tt> (obsolete)</tt></td></tr>
</table>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QScriptValue </td><td class="memItemRight bottomAlign"><b><a href="qscriptengine-obsolete.html#qScriptValueFromValue-2">qScriptValueFromValue</a></b>(QScriptEngine *<i> engine</i>, const T &amp;<i> value</i>)<tt> (obsolete)</tt></td></tr>
</table>
<h2>Member Function Documentation</h2>
<!-- $$$canEvaluate[overload1]$$$canEvaluateconstQString& -->
<h3 class="fn"><a name="canEvaluate"></a><span class="type">bool</span> QScriptEngine::<span class="name">canEvaluate</span>(const <span class="type">QString</span> &amp;<i> program</i>) const</h3>
<p>Returns true if <i>program</i> can be evaluated; i.e&#x2e; the code is sufficient to determine whether it appears to be a syntactically correct program, or contains a syntax error.</p>
<p>This function returns false if <i>program</i> is incomplete; i.e&#x2e; the input is syntactically correct up to the point where the input is terminated.</p>
<p>Note that this function only does a static check of <i>program</i>; e.g&#x2e; it does not check whether references to variables are valid, and so on.</p>
<p>A typical usage of canEvaluate() is to implement an interactive interpreter for Qt Script. The user is repeatedly queried for individual lines of code; the lines are concatened internally, and only when canEvaluate() returns true for the resulting program is it passed to <a href="qscriptengine.html#evaluate">evaluate</a>().</p>
<p>The following are some examples to illustrate the behavior of canEvaluate(). (Note that all example inputs are assumed to have an explicit newline as their last character, since otherwise the Qt Script parser would automatically insert a semi-colon character at the end of the input, and this could cause canEvaluate() to produce different results.)</p>
<p>Given the input</p>
<pre class="cpp"><span class="keyword">if</span> (hello <span class="operator">&amp;</span><span class="operator">&amp;</span> world)
    print(<span class="string">&quot;hello world&quot;</span>);</pre>
<p>canEvaluate() will return true, since the program appears to be complete.</p>
<p>Given the input</p>
<pre class="cpp"><span class="keyword">if</span> (hello <span class="operator">&amp;</span><span class="operator">&amp;</span></pre>
<p>canEvaluate() will return false, since the if-statement is not complete, but is syntactically correct so far.</p>
<p>Given the input</p>
<pre class="cpp"><span class="number">0</span> <span class="operator">=</span> <span class="number">0</span></pre>
<p>canEvaluate() will return true, but <a href="qscriptengine.html#evaluate">evaluate</a>() will throw a SyntaxError given the same input.</p>
<p>Given the input</p>
<pre class="cpp"><span class="operator">.</span><span class="operator">/</span>test<span class="operator">.</span>js</pre>
<p>canEvaluate() will return true, even though the code is clearly not syntactically valid Qt Script code. <a href="qscriptengine.html#evaluate">evaluate</a>() will throw a SyntaxError when this code is evaluated.</p>
<p>Given the input</p>
<pre class="cpp">foo<span class="operator">[</span><span class="string">&quot;bar&quot;</span><span class="operator">]</span></pre>
<p>canEvaluate() will return true, but <a href="qscriptengine.html#evaluate">evaluate</a>() will throw a ReferenceError if <tt>foo</tt> is not defined in the script environment.</p>
<p><b>See also </b><a href="qscriptengine.html#evaluate">evaluate</a>() and <a href="qscriptengine.html#checkSyntax">checkSyntax</a>().</p>
<!-- @@@canEvaluate -->
<h2>Related Non-Members</h2>
<!-- $$$qScriptValueFromValue$$$qScriptValueFromValueQScriptEngine*constT& -->
<h3 class="fn"><a name="qScriptValueFromValue-2"></a><span class="type"><a href="qscriptvalue.html">QScriptValue</a></span> <span class="name">qScriptValueFromValue</span>(<span class="type">QScriptEngine</span> *<i> engine</i>, const <span class="type">T</span> &amp;<i> value</i>)</h3>
<p>Creates a <a href="qscriptvalue.html">QScriptValue</a> using the given <i>engine</i> with the given <i>value</i> of template type <tt>T</tt>.</p>
<p>This function is equivalent to <a href="qscriptengine.html#toScriptValue">QScriptEngine::toScriptValue</a>().</p>
<p><b>Note: </b>This function was provided as a workaround for MSVC 6 which did not support member template functions. It is advised to use the other form in new code.</p><p>This function was introduced in  Qt 4.3.</p>
<p><b>See also </b><a href="qscriptengine.html#toScriptValue">QScriptEngine::toScriptValue</a>() and <a href="qscriptvalue.html#qscriptvalue_cast">qscriptvalue_cast</a>().</p>
<!-- @@@qScriptValueFromValue -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
   subsidiaries. Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Digia, Qt and their respective logos are trademarks of Digia Plc     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>