| <!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"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.8.6"/> |
| <title>Impala: impala::StringParser Class Reference</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(initResizable); |
| $(window).load(resizeHeight); |
| </script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/search.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(function() { searchBox.OnSelectItem(0); }); |
| </script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname">Impala |
| </div> |
| <div id="projectbrief">Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.6 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
| <li><a href="files.html"><span>Files</span></a></li> |
| <li> |
| <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.png" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| </span> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div id="navrow2" class="tabs2"> |
| <ul class="tablist"> |
| <li><a href="annotated.html"><span>Class List</span></a></li> |
| <li><a href="classes.html"><span>Class Index</span></a></li> |
| <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> |
| <li><a href="functions.html"><span>Class Members</span></a></li> |
| </ul> |
| </div> |
| </div><!-- top --> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| <div id="nav-sync" class="sync"></div> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| $(document).ready(function(){initNavTree('classimpala_1_1StringParser.html','');}); |
| </script> |
| <div id="doc-content"> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Macros</a></div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <iframe src="javascript:void(0)" frameborder="0" |
| name="MSearchResults" id="MSearchResults"> |
| </iframe> |
| </div> |
| |
| <div class="header"> |
| <div class="summary"> |
| <a href="#nested-classes">Classes</a> | |
| <a href="#pub-types">Public Types</a> | |
| <a href="#pub-static-methods">Static Public Member Functions</a> | |
| <a href="#pri-static-methods">Static Private Member Functions</a> | |
| <a href="classimpala_1_1StringParser-members.html">List of all members</a> </div> |
| <div class="headertitle"> |
| <div class="title">impala::StringParser Class Reference</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| |
| <p><code>#include <<a class="el" href="string-parser_8h_source.html">string-parser.h</a>></code></p> |
| <div class="dynheader"> |
| Collaboration diagram for impala::StringParser:</div> |
| <div class="dyncontent"> |
| <div class="center"><iframe scrolling="no" frameborder="0" src="classimpala_1_1StringParser__coll__graph.svg" width="190" height="280"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div> |
| </div> |
| <table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> |
| Classes</h2></td></tr> |
| <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser_1_1StringParseTraits.html">StringParseTraits</a></td></tr> |
| <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> |
| Public Types</h2></td></tr> |
| <tr class="memitem:ade4ec9c83a29225438abea9b8c15e2c2"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> { <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2a5112bf3bfbadd918485dcbe1255b2726">PARSE_SUCCESS</a> = 0, |
| <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2a7ffd93037cdb317e789f79de83fab352">PARSE_FAILURE</a>, |
| <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2a218bf20f6d7ee34d6f8efb3018c22e3b">PARSE_OVERFLOW</a>, |
| <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2aaaa95f015745cf4be9bf317f8f1fe017">PARSE_UNDERFLOW</a> |
| }</td></tr> |
| <tr class="separator:ade4ec9c83a29225438abea9b8c15e2c2"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> |
| Static Public Member Functions</h2></td></tr> |
| <tr class="memitem:accdcfe14b3e60df9b67dbd0d21a6bf18"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:accdcfe14b3e60df9b67dbd0d21a6bf18"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#accdcfe14b3e60df9b67dbd0d21a6bf18">StringToInt</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:accdcfe14b3e60df9b67dbd0d21a6bf18"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ab1504839dd39541e7423bebbf494b480"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:ab1504839dd39541e7423bebbf494b480"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#ab1504839dd39541e7423bebbf494b480">StringToInt</a> (const char *s, int len, int base, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="memdesc:ab1504839dd39541e7423bebbf494b480"><td class="mdescLeft"> </td><td class="mdescRight">Convert a string s representing a number in given base into a decimal number. <a href="#ab1504839dd39541e7423bebbf494b480">More...</a><br/></td></tr> |
| <tr class="separator:ab1504839dd39541e7423bebbf494b480"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:acc6de4ab6994683cf8ae17da8a0eade9"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:acc6de4ab6994683cf8ae17da8a0eade9"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#acc6de4ab6994683cf8ae17da8a0eade9">StringToFloat</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:acc6de4ab6994683cf8ae17da8a0eade9"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a6e834cf632a1e1353d4e3e8be6594ac8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a6e834cf632a1e1353d4e3e8be6594ac8">StringToBool</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="memdesc:a6e834cf632a1e1353d4e3e8be6594ac8"><td class="mdescLeft"> </td><td class="mdescRight">Parses a string for 'true' or 'false', case insensitive. <a href="#a6e834cf632a1e1353d4e3e8be6594ac8">More...</a><br/></td></tr> |
| <tr class="separator:a6e834cf632a1e1353d4e3e8be6594ac8"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a94b1336619c7b72730b8826819bd44cf"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:a94b1336619c7b72730b8826819bd44cf"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classimpala_1_1DecimalValue.html">DecimalValue</a>< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a94b1336619c7b72730b8826819bd44cf">StringToDecimal</a> (const uint8_t *s, int len, const <a class="el" href="structimpala_1_1ColumnType.html">ColumnType</a> &type, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">StringParser::ParseResult</a> *result)</td></tr> |
| <tr class="separator:a94b1336619c7b72730b8826819bd44cf"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ad64b211e42d5cd130313762e52569d98"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:ad64b211e42d5cd130313762e52569d98"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classimpala_1_1DecimalValue.html">DecimalValue</a>< T > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#ad64b211e42d5cd130313762e52569d98">StringToDecimal</a> (const char *s, int len, const <a class="el" href="structimpala_1_1ColumnType.html">ColumnType</a> &type, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">StringParser::ParseResult</a> *result)</td></tr> |
| <tr class="separator:ad64b211e42d5cd130313762e52569d98"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-methods"></a> |
| Static Private Member Functions</h2></td></tr> |
| <tr class="memitem:aa368ae674333387567bef8b0af429d81"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:aa368ae674333387567bef8b0af429d81"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#aa368ae674333387567bef8b0af429d81">StringToIntInternal</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:aa368ae674333387567bef8b0af429d81"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:ad0033aca12dc48b13ece527d9109ad92"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:ad0033aca12dc48b13ece527d9109ad92"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#ad0033aca12dc48b13ece527d9109ad92">StringToIntInternal</a> (const char *s, int len, int base, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:ad0033aca12dc48b13ece527d9109ad92"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a0384d41efddff09a8a2d46be8fec9ed6"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:a0384d41efddff09a8a2d46be8fec9ed6"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a0384d41efddff09a8a2d46be8fec9ed6">StringToFloatInternal</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:a0384d41efddff09a8a2d46be8fec9ed6"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a0beeee7a9330ff0845c3ef046a8ca40d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a0beeee7a9330ff0845c3ef046a8ca40d">StringToBoolInternal</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:a0beeee7a9330ff0845c3ef046a8ca40d"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a27b446e48a5b4da7a320c427fb5ecae1"><td class="memItemLeft" align="right" valign="top">static int </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a27b446e48a5b4da7a320c427fb5ecae1">SkipLeadingWhitespace</a> (const char *s, int len)</td></tr> |
| <tr class="memdesc:a27b446e48a5b4da7a320c427fb5ecae1"><td class="mdescLeft"> </td><td class="mdescRight">Returns the position of the first non-whitespace character in s. <a href="#a27b446e48a5b4da7a320c427fb5ecae1">More...</a><br/></td></tr> |
| <tr class="separator:a27b446e48a5b4da7a320c427fb5ecae1"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a0613a2759d4eb399d8efb82ca81a4ad2"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a0613a2759d4eb399d8efb82ca81a4ad2">IsAllWhitespace</a> (const char *s, int len)</td></tr> |
| <tr class="memdesc:a0613a2759d4eb399d8efb82ca81a4ad2"><td class="mdescLeft"> </td><td class="mdescRight">Returns true if s only contains whitespace. <a href="#a0613a2759d4eb399d8efb82ca81a4ad2">More...</a><br/></td></tr> |
| <tr class="separator:a0613a2759d4eb399d8efb82ca81a4ad2"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a9cea1e69cac9dc4dcdc22161534d4b70"><td class="memTemplParams" colspan="2">template<typename T > </td></tr> |
| <tr class="memitem:a9cea1e69cac9dc4dcdc22161534d4b70"><td class="memTemplItemLeft" align="right" valign="top">static T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a9cea1e69cac9dc4dcdc22161534d4b70">StringToIntNoOverflow</a> (const char *s, int len, <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> *result)</td></tr> |
| <tr class="separator:a9cea1e69cac9dc4dcdc22161534d4b70"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a94a90a8a3347cb866f4e06f016e24f50"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classbool.html">bool</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1StringParser.html#a94a90a8a3347cb866f4e06f016e24f50">IsWhitespace</a> (const char &c)</td></tr> |
| <tr class="separator:a94a90a8a3347cb866f4e06f016e24f50"><td class="memSeparator" colspan="2"> </td></tr> |
| </table> |
| <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| <div class="textblock"><p>Utility functions for doing atoi/atof on non-null terminated strings. On micro benchmarks, this is significantly faster than libc (atoi/strtol and atof/strtod). Strings with leading and trailing whitespaces are accepted. Branching is heavily optimized for the non-whitespace successful case. All the StringTo* functions first parse the input string assuming it has no leading whitespace. If that first attempt was unsuccessful, these functions retry the parsing after removing whitespace. Therefore, strings with whitespace take a perf hit on branch mis-prediction. For overflows, we are following the mysql behavior, to cap values at the max/min value for that data type. This is different from hive, which returns NULL for overflow slots for int types and inf/-inf for float types. Things we tried that did not work:</p> |
| <ul> |
| <li>lookup table for converting character to digit Improvements (TODO):</li> |
| <li>Validate input using _sidd_compare_ranges</li> |
| <li>Since we know the length, we can parallelize this: i.e. result = 100*s[0] + 10*s[1] + s[2] </li> |
| </ul> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00049">49</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| </div><h2 class="groupheader">Member Enumeration Documentation</h2> |
| <a class="anchor" id="ade4ec9c83a29225438abea9b8c15e2c2"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">enum <a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">impala::StringParser::ParseResult</a></td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <table class="fieldtable"> |
| <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ade4ec9c83a29225438abea9b8c15e2c2a5112bf3bfbadd918485dcbe1255b2726"></a>PARSE_SUCCESS</em> </td><td class="fielddoc"> |
| </td></tr> |
| <tr><td class="fieldname"><em><a class="anchor" id="ade4ec9c83a29225438abea9b8c15e2c2a7ffd93037cdb317e789f79de83fab352"></a>PARSE_FAILURE</em> </td><td class="fielddoc"> |
| </td></tr> |
| <tr><td class="fieldname"><em><a class="anchor" id="ade4ec9c83a29225438abea9b8c15e2c2a218bf20f6d7ee34d6f8efb3018c22e3b"></a>PARSE_OVERFLOW</em> </td><td class="fielddoc"> |
| </td></tr> |
| <tr><td class="fieldname"><em><a class="anchor" id="ade4ec9c83a29225438abea9b8c15e2c2aaaa95f015745cf4be9bf317f8f1fe017"></a>PARSE_UNDERFLOW</em> </td><td class="fielddoc"> |
| </td></tr> |
| </table> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00051">51</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| </div> |
| </div> |
| <h2 class="groupheader">Member Function Documentation</h2> |
| <a class="anchor" id="a0613a2759d4eb399d8efb82ca81a4ad2"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="classbool.html">bool</a> impala::StringParser::IsAllWhitespace </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Returns true if s only contains whitespace. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00494">494</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00543">IsWhitespace()</a>, and <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>.</p> |
| |
| <p>Referenced by <a class="el" href="string-parser_8h_source.html#l00468">StringToBoolInternal()</a>, <a class="el" href="string-parser_8h_source.html#l00357">StringToFloatInternal()</a>, <a class="el" href="string-parser_8h_source.html#l00236">StringToIntInternal()</a>, and <a class="el" href="string-parser_8h_source.html#l00513">StringToIntNoOverflow()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a94a90a8a3347cb866f4e06f016e24f50"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="classbool.html">bool</a> impala::StringParser::IsWhitespace </td> |
| <td>(</td> |
| <td class="paramtype">const char & </td> |
| <td class="paramname"><em>c</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00543">543</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="compiler-util_8h_source.html#l00033">UNLIKELY</a>.</p> |
| |
| <p>Referenced by <a class="el" href="string-parser_8h_source.html#l00494">IsAllWhitespace()</a>, <a class="el" href="string-parser_8h_source.html#l00487">SkipLeadingWhitespace()</a>, and <a class="el" href="string-parser_8h_source.html#l00106">StringToDecimal()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a27b446e48a5b4da7a320c427fb5ecae1"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static int impala::StringParser::SkipLeadingWhitespace </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Returns the position of the first non-whitespace character in s. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00487">487</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00543">IsWhitespace()</a>.</p> |
| |
| <p>Referenced by <a class="el" href="string-parser_8h_source.html#l00087">StringToBool()</a>, <a class="el" href="string-parser_8h_source.html#l00078">StringToFloat()</a>, and <a class="el" href="string-parser_8h_source.html#l00059">StringToInt()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a6e834cf632a1e1353d4e3e8be6594ac8"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="classbool.html">bool</a> impala::StringParser::StringToBool </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Parses a string for 'true' or 'false', case insensitive. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00087">87</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, <a class="el" href="string-parser_8h_source.html#l00487">SkipLeadingWhitespace()</a>, and <a class="el" href="string-parser_8h_source.html#l00468">StringToBoolInternal()</a>.</p> |
| |
| <p>Referenced by <a class="el" href="string-parser-test_8cc_source.html#l00066">impala::TestBoolValue()</a>, and <a class="el" href="text-converter_8inline_8h_source.html#l00037">impala::TextConverter::WriteSlot()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a0beeee7a9330ff0845c3ef046a8ca40d"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="classbool.html">bool</a> impala::StringParser::StringToBoolInternal </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Parses a string for 'true' or 'false', case insensitive. Return PARSE_FAILURE on leading whitespace. Trailing whitespace is allowed. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00468">468</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00494">IsAllWhitespace()</a>, <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00053">PARSE_FAILURE</a>, and <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>.</p> |
| |
| <p>Referenced by <a class="el" href="string-parser_8h_source.html#l00087">StringToBool()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a94b1336619c7b72730b8826819bd44cf"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="classimpala_1_1DecimalValue.html">DecimalValue</a><T> impala::StringParser::StringToDecimal </td> |
| <td>(</td> |
| <td class="paramtype">const uint8_t * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="structimpala_1_1ColumnType.html">ColumnType</a> & </td> |
| <td class="paramname"><em>type</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">StringParser::ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Parses a decimal from s, returning the result. The parse status is returned in *result. On overflow or invalid values, the return value is undefined. On underflow, the truncated value is returned. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00100">100</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="ad64b211e42d5cd130313762e52569d98"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static <a class="el" href="classimpala_1_1DecimalValue.html">DecimalValue</a><T> impala::StringParser::StringToDecimal </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">const <a class="el" href="structimpala_1_1ColumnType.html">ColumnType</a> & </td> |
| <td class="paramname"><em>type</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">StringParser::ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00106">106</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00543">IsWhitespace()</a>, <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00053">PARSE_FAILURE</a>, <a class="el" href="string-parser_8h_source.html#l00054">PARSE_OVERFLOW</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, <a class="el" href="string-parser_8h_source.html#l00055">PARSE_UNDERFLOW</a>, <a class="el" href="types_8h_source.html#l00068">impala::ColumnType::precision</a>, <a class="el" href="types_8h_source.html#l00068">impala::ColumnType::scale</a>, and <a class="el" href="compiler-util_8h_source.html#l00033">UNLIKELY</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="acc6de4ab6994683cf8ae17da8a0eade9"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToFloat </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00078">78</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="string-parser_8h_source.html#l00487">SkipLeadingWhitespace()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a0384d41efddff09a8a2d46be8fec9ed6"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToFloatInternal </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>This is considerably faster than glibc's implementation (>100x why???) No special case handling needs to be done for overflows, the floating point spec already does it and will cap the values to -inf/inf To avoid inaccurate conversions this function falls back to strtod for scientific notation. Return PARSE_FAILURE on leading whitespace. Trailing whitespace is allowed. TODO: Investigate using intrinsics to speed up the slow strtod path. TODO: there are other possible optimizations, see IMPALA-1729 </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00357">357</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00494">IsAllWhitespace()</a>, <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00053">PARSE_FAILURE</a>, <a class="el" href="string-parser_8h_source.html#l00054">PARSE_OVERFLOW</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="compiler-util_8h_source.html#l00033">UNLIKELY</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="accdcfe14b3e60df9b67dbd0d21a6bf18"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToInt </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00059">59</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="string-parser_8h_source.html#l00487">SkipLeadingWhitespace()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="ab1504839dd39541e7423bebbf494b480"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToInt </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>base</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Convert a string s representing a number in given base into a decimal number. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00069">69</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="string-parser_8h_source.html#l00487">SkipLeadingWhitespace()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="aa368ae674333387567bef8b0af429d81"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToIntInternal </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>This is considerably faster than glibc's implementation. In the case of overflow, the max/min value for the data type will be returned. Assumes s represents a decimal number. Return PARSE_FAILURE on leading whitespace. Trailing whitespace is allowed. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00236">236</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00494">IsAllWhitespace()</a>, <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00053">PARSE_FAILURE</a>, <a class="el" href="string-parser_8h_source.html#l00054">PARSE_OVERFLOW</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="compiler-util_8h_source.html#l00033">UNLIKELY</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="ad0033aca12dc48b13ece527d9109ad92"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToIntInternal </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>base</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Convert a string s representing a number in given base into a decimal number. Return PARSE_FAILURE on leading whitespace. Trailing whitespace is allowed. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00292">292</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00494">IsAllWhitespace()</a>, <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00053">PARSE_FAILURE</a>, <a class="el" href="string-parser_8h_source.html#l00054">PARSE_OVERFLOW</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="compiler-util_8h_source.html#l00033">UNLIKELY</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a9cea1e69cac9dc4dcdc22161534d4b70"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <div class="memtemplate"> |
| template<typename T > </div> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">static T impala::StringParser::StringToIntNoOverflow </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"><em>s</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>len</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StringParser.html#ade4ec9c83a29225438abea9b8c15e2c2">ParseResult</a> * </td> |
| <td class="paramname"><em>result</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Converts an ascii string to an integer of type T assuming it cannot overflow and the number is positive. Leading whitespace is not allowed. Trailing whitespace will be skipped. </p> |
| |
| <p>Definition at line <a class="el" href="string-parser_8h_source.html#l00513">513</a> of file <a class="el" href="string-parser_8h_source.html">string-parser.h</a>.</p> |
| |
| <p>References <a class="el" href="string-parser_8h_source.html#l00494">IsAllWhitespace()</a>, <a class="el" href="compiler-util_8h_source.html#l00032">LIKELY</a>, <a class="el" href="string-parser_8h_source.html#l00053">PARSE_FAILURE</a>, <a class="el" href="string-parser_8h_source.html#l00052">PARSE_SUCCESS</a>, and <a class="el" href="compiler-util_8h_source.html#l00033">UNLIKELY</a>.</p> |
| |
| </div> |
| </div> |
| <hr/>The documentation for this class was generated from the following file:<ul> |
| <li>be/src/util/<a class="el" href="string-parser_8h_source.html">string-parser.h</a></li> |
| </ul> |
| </div><!-- contents --> |
| </div><!-- doc-content --> |
| <!-- start footer part --> |
| <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| <ul> |
| <li class="navelem"><a class="el" href="namespaceimpala.html">impala</a></li><li class="navelem"><a class="el" href="classimpala_1_1StringParser.html">StringParser</a></li> |
| <li class="footer">Generated on Thu May 7 2015 16:10:50 for Impala by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |