<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- qsourcelocation.cpp --> <head> <title>Qt 4.6: QSourceLocation Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QSourceLocation"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QSourceLocation Class Reference<br /><span class="small-subtitle">[<a href="qtxmlpatterns.html">QtXmlPatterns</a> module]</span> </h1> <p>The QSourceLocation class identifies a location in a resource by URI, line, and column. <a href="#details">More...</a></p> <pre> #include <QSourceLocation></pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p> <p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p> <p>This class was introduced in Qt 4.4.</p> <ul> <li><a href="qsourcelocation-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#QSourceLocation">QSourceLocation</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#QSourceLocation-2">QSourceLocation</a></b> ( const QSourceLocation & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#QSourceLocation-3">QSourceLocation</a></b> ( const QUrl & <i>u</i>, int <i>l</i> = -1, int <i>c</i> = -1 )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#dtor.QSourceLocation">~QSourceLocation</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">qint64 </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#column">column</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#isNull">isNull</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">qint64 </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#line">line</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#setColumn">setColumn</a></b> ( qint64 <i>newColumn</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#setLine">setLine</a></b> ( qint64 <i>newLine</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#setUri">setUri</a></b> ( const QUrl & <i>newUri</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QUrl </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#uri">uri</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#operator-not-eq">operator!=</a></b> ( const QSourceLocation & <i>other</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QSourceLocation & </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#operator-eq">operator=</a></b> ( const QSourceLocation & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#operator-eq-eq">operator==</a></b> ( const QSourceLocation & <i>other</i> ) const</td></tr> </table> <hr /> <a name="related-non-members"></a> <h2>Related Non-Members</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">uint </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#qHash-34">qHash</a></b> ( const QSourceLocation & <i>location</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QDebug </td><td class="memItemRight" valign="bottom"><b><a href="qsourcelocation.html#operator-lt-lt-167">operator<<</a></b> ( QDebug <i>debug</i>, const QSourceLocation & <i>sourceLocation</i> )</td></tr> </table> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QSourceLocation class identifies a location in a resource by URI, line, and column.</p> <p>QSourceLocation is a simple value based class that has three properties, <a href="qsourcelocation.html#uri">uri</a>(), <a href="qsourcelocation.html#line">line</a>(), and <a href="qsourcelocation.html#column">column</a>(), that, taken together, identify a certain point in a resource, e.g., a file or an in-memory document.</p> <p><a href="qsourcelocation.html#line">line</a>() and <a href="qsourcelocation.html#column">column</a>() refer to character counts (not byte counts), and they both start from 1, as opposed to 0.</p> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QSourceLocation/QSourceLocation"></a> <h3 class="fn"><a name="QSourceLocation"></a>QSourceLocation::QSourceLocation ()</h3> <p>Construct a <a href="qsourcelocation.html">QSourceLocation</a> that doesn't identify anything at all.</p> <p>For a default constructed QSourceLocation(), <a href="qsourcelocation.html#isNull">isNull</a>() returns <tt>true</tt>.</p> <h3 class="fn"><a name="QSourceLocation-2"></a>QSourceLocation::QSourceLocation ( const QSourceLocation & <i>other</i> )</h3> <p>Constructs a <a href="qsourcelocation.html">QSourceLocation</a> that is a copy of <i>other</i>.</p> <h3 class="fn"><a name="QSourceLocation-3"></a>QSourceLocation::QSourceLocation ( const <a href="qurl.html">QUrl</a> & <i>u</i>, int <i>l</i> = -1, int <i>c</i> = -1 )</h3> <p>Constructs a <a href="qsourcelocation.html">QSourceLocation</a> with URI <i>u</i>, line <i>l</i> and column <i>c</i>.</p> <a name="//apple_ref/cpp/instm/QSourceLocation/~QSourceLocation"></a> <h3 class="fn"><a name="dtor.QSourceLocation"></a>QSourceLocation::~QSourceLocation ()</h3> <p>Destructor.</p> <a name="//apple_ref/cpp/instm/QSourceLocation/column"></a> <h3 class="fn"><a name="column"></a><a href="qtglobal.html#qint64-typedef">qint64</a> QSourceLocation::column () const</h3> <p>Returns the current column number. The column number refers to the count of characters, not bytes. The first column is column 1, not 0. The default value is -1, indicating the column number is unknown.</p> <p>See also <a href="qsourcelocation.html#setColumn">setColumn</a>().</p> <a name="//apple_ref/cpp/instm/QSourceLocation/isNull"></a> <h3 class="fn"><a name="isNull"></a>bool QSourceLocation::isNull () const</h3> <p>Returns <tt>true</tt> if this <a href="qsourcelocation.html">QSourceLocation</a> doesn't identify anything.</p> <p>For a default constructed <a href="qsourcelocation.html">QSourceLocation</a>, this function returns <tt>true</tt>. The same applies for any other <a href="qsourcelocation.html">QSourceLocation</a> whose <a href="qsourcelocation.html#uri">uri</a>() is invalid.</p> <a name="//apple_ref/cpp/instm/QSourceLocation/line"></a> <h3 class="fn"><a name="line"></a><a href="qtglobal.html#qint64-typedef">qint64</a> QSourceLocation::line () const</h3> <p>Returns the current line number. The first line number is 1, not 0. The default value is -1, indicating the line number is unknown.</p> <p>See also <a href="qsourcelocation.html#setLine">setLine</a>().</p> <a name="//apple_ref/cpp/instm/QSourceLocation/setColumn"></a> <h3 class="fn"><a name="setColumn"></a>void QSourceLocation::setColumn ( <a href="qtglobal.html#qint64-typedef">qint64</a> <i>newColumn</i> )</h3> <p>Sets the column number to <i>newColumn</i>. 0 is an invalid column number. The first column number is 1.</p> <p>See also <a href="qsourcelocation.html#column">column</a>().</p> <a name="//apple_ref/cpp/instm/QSourceLocation/setLine"></a> <h3 class="fn"><a name="setLine"></a>void QSourceLocation::setLine ( <a href="qtglobal.html#qint64-typedef">qint64</a> <i>newLine</i> )</h3> <p>Sets the line number to <i>newLine</i>. 0 is an invalid line number. The first line number is 1.</p> <p>See also <a href="qsourcelocation.html#line">line</a>().</p> <a name="//apple_ref/cpp/instm/QSourceLocation/setUri"></a> <h3 class="fn"><a name="setUri"></a>void QSourceLocation::setUri ( const <a href="qurl.html">QUrl</a> & <i>newUri</i> )</h3> <p>Sets the URI to <i>newUri</i>.</p> <p>See also <a href="qsourcelocation.html#uri">uri</a>().</p> <a name="//apple_ref/cpp/instm/QSourceLocation/uri"></a> <h3 class="fn"><a name="uri"></a><a href="qurl.html">QUrl</a> QSourceLocation::uri () const</h3> <p>Returns the resource that this <a href="qsourcelocation.html">QSourceLocation</a> refers to. For example, the resource could be a file in the local file system, if the URI scheme is <tt>file</tt>.</p> <p>See also <a href="qsourcelocation.html#setUri">setUri</a>().</p> <a name="//apple_ref/cpp/instm/QSourceLocation/operator!="></a> <h3 class="fn"><a name="operator-not-eq"></a>bool QSourceLocation::operator!= ( const QSourceLocation & <i>other</i> ) const</h3> <p>Returns the opposite of applying operator==() for this <a href="qxmlname.html">QXmlName</a> and <i>other</i>.</p> <a name="//apple_ref/cpp/instm/QSourceLocation/operator="></a> <h3 class="fn"><a name="operator-eq"></a>QSourceLocation & QSourceLocation::operator= ( const QSourceLocation & <i>other</i> )</h3> <p>Assigns this <a href="qsourcelocation.html">QSourceLocation</a> instance to <i>other</i>.</p> <a name="//apple_ref/cpp/instm/QSourceLocation/operator=="></a> <h3 class="fn"><a name="operator-eq-eq"></a>bool QSourceLocation::operator== ( const QSourceLocation & <i>other</i> ) const</h3> <p>Returns true if this <a href="qsourcelocation.html">QSourceLocation</a> is identical to <i>other</i>.</p> <p>Two <a href="qsourcelocation.html">QSourceLocation</a> instances are equal if their <a href="qsourcelocation.html#uri">uri</a>(), <a href="qsourcelocation.html#line">line</a>() and <a href="qsourcelocation.html#column">column</a>() are equal.</p> <p><a href="qsourcelocation.html">QSourceLocation</a> instances for which <a href="qsourcelocation.html#isNull">isNull</a>() returns true are considered equal.</p> <hr /> <h2>Related Non-Members</h2> <h3 class="fn"><a name="qHash-34"></a><a href="qtglobal.html#uint-typedef">uint</a> qHash ( const QSourceLocation & <i>location</i> )</h3> <p>Computes a hash key for the <a href="qsourcelocation.html">QSourceLocation</a> <i>location</i>.</p> <p>This function was introduced in Qt 4.4.</p> <h3 class="fn"><a name="operator-lt-lt-167"></a><a href="qdebug.html">QDebug</a> operator<< ( <a href="qdebug.html">QDebug</a> <i>debug</i>, const QSourceLocation & <i>sourceLocation</i> )</h3> <p>Prints <i>sourceLocation</i> to the debug stream <i>debug</i>.</p> <p>This function was introduced in Qt 4.4.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>