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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>libqalculate-0.9.6: Unit Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.3 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div>
<h1>Unit Class Reference</h1><!-- doxytag: class=<Unit> --><!-- doxytag: inherits=<ExpressionItem> -->A unit for measurement.
<a href="#_details">More...</a>
<p>
<code>#include <Unit.h></code>
<p>
<p>Inheritance diagram for Unit:
<p><center><img src="classUnit.png" usemap="#Unit_map" border="0" alt=""></center>
<map name="Unit_map">
<area href="classExpressionItem.html" alt="ExpressionItem" shape="rect" coords="68,0,194,24">
<area href="classAliasUnit.html" alt="AliasUnit" shape="rect" coords="0,112,126,136">
<area href="classCompositeUnit.html" alt="CompositeUnit" shape="rect" coords="136,112,262,136">
<area href="classAliasUnit__Composite.html" alt="AliasUnit_Composite" shape="rect" coords="0,168,126,192">
</map>
<a href="classUnit-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0"></a><!-- doxytag: member=<Unit::Unit> ref=<a0> args=<(string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)> -->
</td><td class="memItemRight" valign="bottom"><b>Unit</b> (string cat_, string name_, string plural_="", string singular_="", string title_="", bool is_local=true, bool is_builtin=false, bool is_active=true)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2"></a><!-- doxytag: member=<Unit::Unit> ref=<a2> args=<(const Unit *unit)> -->
</td><td class="memItemRight" valign="bottom"><b>Unit</b> (const <a class="el" href="classUnit.html">Unit</a> *unit)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4"></a><!-- doxytag: member=<Unit::copy> ref=<a4> args=<() const > -->
virtual <a class="el" href="classExpressionItem.html">ExpressionItem</a> * </td><td class="memItemRight" valign="bottom"><b>copy</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5"></a><!-- doxytag: member=<Unit::set> ref=<a5> args=<(const ExpressionItem *item)> -->
virtual void </td><td class="memItemRight" valign="bottom"><b>set</b> (const <a class="el" href="classExpressionItem.html">ExpressionItem</a> *item)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a6">isSIUnit</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a7">setAsSIUnit</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a8">setSystem</a> (string s_system)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a9">system</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a10">isCurrency</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual string </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a11">print</a> (bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a12"></a><!-- doxytag: member=<Unit::plural> ref=<a12> args=<(bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const > -->
virtual const string & </td><td class="memItemRight" valign="bottom"><b>plural</b> (bool return_singular_if_no_plural=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a13"></a><!-- doxytag: member=<Unit::singular> ref=<a13> args=<(bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const > -->
virtual const string & </td><td class="memItemRight" valign="bottom"><b>singular</b> (bool return_abbreviation_if_no_singular=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a14"></a><!-- doxytag: member=<Unit::abbreviation> ref=<a14> args=<(bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const > -->
virtual const string & </td><td class="memItemRight" valign="bottom"><b>abbreviation</b> (bool return_singular_if_no_abbreviation=true, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a15"></a><!-- doxytag: member=<Unit::isUsedByOtherUnits> ref=<a15> args=<() const > -->
virtual bool </td><td class="memItemRight" valign="bottom"><b>isUsedByOtherUnits</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a16"></a><!-- doxytag: member=<Unit::baseUnit> ref=<a16> args=<() const > -->
virtual <a class="el" href="classUnit.html">Unit</a> * </td><td class="memItemRight" valign="bottom"><b>baseUnit</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a17"></a><!-- doxytag: member=<Unit::convertToBaseUnit> ref=<a17> args=<(MathStructure &mvalue, MathStructure &mexp) const > -->
virtual <a class="el" href="classMathStructure.html">MathStructure</a> & </td><td class="memItemRight" valign="bottom"><b>convertToBaseUnit</b> (<a class="el" href="classMathStructure.html">MathStructure</a> &mvalue, <a class="el" href="classMathStructure.html">MathStructure</a> &mexp) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a18"></a><!-- doxytag: member=<Unit::convertFromBaseUnit> ref=<a18> args=<(MathStructure &mvalue, MathStructure &mexp) const > -->
virtual <a class="el" href="classMathStructure.html">MathStructure</a> & </td><td class="memItemRight" valign="bottom"><b>convertFromBaseUnit</b> (<a class="el" href="classMathStructure.html">MathStructure</a> &mvalue, <a class="el" href="classMathStructure.html">MathStructure</a> &mexp) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a19"></a><!-- doxytag: member=<Unit::convertToBaseUnit> ref=<a19> args=<(MathStructure &mvalue) const > -->
virtual <a class="el" href="classMathStructure.html">MathStructure</a> & </td><td class="memItemRight" valign="bottom"><b>convertToBaseUnit</b> (<a class="el" href="classMathStructure.html">MathStructure</a> &mvalue) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a20"></a><!-- doxytag: member=<Unit::convertFromBaseUnit> ref=<a20> args=<(MathStructure &mvalue) const > -->
virtual <a class="el" href="classMathStructure.html">MathStructure</a> & </td><td class="memItemRight" valign="bottom"><b>convertFromBaseUnit</b> (<a class="el" href="classMathStructure.html">MathStructure</a> &mvalue) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a21"></a><!-- doxytag: member=<Unit::convertToBaseUnit> ref=<a21> args=<() const > -->
virtual <a class="el" href="classMathStructure.html">MathStructure</a> </td><td class="memItemRight" valign="bottom"><b>convertToBaseUnit</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a22"></a><!-- doxytag: member=<Unit::convertFromBaseUnit> ref=<a22> args=<() const > -->
virtual <a class="el" href="classMathStructure.html">MathStructure</a> </td><td class="memItemRight" valign="bottom"><b>convertFromBaseUnit</b> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a23"></a><!-- doxytag: member=<Unit::baseExponent> ref=<a23> args=<(int exp=1) const > -->
virtual int </td><td class="memItemRight" valign="bottom"><b>baseExponent</b> (int exp=1) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a24">type</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a25">subtype</a> () const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a26">isChildOf</a> (<a class="el" href="classUnit.html">Unit</a> *u) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a27">isParentOf</a> (<a class="el" href="classUnit.html">Unit</a> *u) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a28"></a><!-- doxytag: member=<Unit::hasComplexRelationTo> ref=<a28> args=<(Unit *u) const > -->
virtual bool </td><td class="memItemRight" valign="bottom"><b>hasComplexRelationTo</b> (<a class="el" href="classUnit.html">Unit</a> *u) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a29">convert</a> (<a class="el" href="classUnit.html">Unit</a> *u, <a class="el" href="classMathStructure.html">MathStructure</a> &mvalue, <a class="el" href="classMathStructure.html">MathStructure</a> &exp) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classUnit.html#a30">convert</a> (<a class="el" href="classUnit.html">Unit</a> *u, <a class="el" href="classMathStructure.html">MathStructure</a> &mvalue) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a31"></a><!-- doxytag: member=<Unit::convert> ref=<a31> args=<(Unit *u, bool *converted=NULL) const > -->
<a class="el" href="classMathStructure.html">MathStructure</a> </td><td class="memItemRight" valign="bottom"><b>convert</b> (<a class="el" href="classUnit.html">Unit</a> *u, bool *converted=NULL) const </td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p0"></a><!-- doxytag: member=<Unit::ssystem> ref=<p0> args=<> -->
string </td><td class="memItemRight" valign="bottom"><b>ssystem</b></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="p1"></a><!-- doxytag: member=<Unit::b_si> ref=<p1> args=<> -->
bool </td><td class="memItemRight" valign="bottom"><b>b_si</b></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A unit for measurement.
<p>
The Unit class both represents a base unit and is the base class for other unit types. Base units are units defined as basis for other units. Meters and seconds are typical base units.<p>
For base units, a name is all that is needed. Base units do however normally have three different names defined for use in expressions - abbreviation (ex. "m"), singular ("meter") and plural ("meters").
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a30"></a><!-- doxytag: member=<Unit::convert> ref=<a30> args=<(Unit *u, MathStructure &mvalue) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool Unit::convert </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classUnit.html">Unit</a> * </td>
<td class="mdname" nowrap> <em>u</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classMathStructure.html">MathStructure</a> & </td>
<td class="mdname" nowrap> <em>mvalue</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Converts a value from specified unit and exponent to this unit. value * unit = new value * this This function cannot convert to or from <a class="el" href="classCompositeUnit.html">CompositeUnit</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>u</em> </td><td>Unit to convert from. </td></tr>
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>mvalue</em> </td><td>Quantity value. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true if the value was successfully converted.</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a29"></a><!-- doxytag: member=<Unit::convert> ref=<a29> args=<(Unit *u, MathStructure &mvalue, MathStructure &exp) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool Unit::convert </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classUnit.html">Unit</a> * </td>
<td class="mdname" nowrap> <em>u</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classMathStructure.html">MathStructure</a> & </td>
<td class="mdname" nowrap> <em>mvalue</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap><a class="el" href="classMathStructure.html">MathStructure</a> & </td>
<td class="mdname" nowrap> <em>exp</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Converts a value from specified unit and exponent to this unit. value * (unit^exponent) = new value * (this^new exponent) This function cannot convert to or from <a class="el" href="classCompositeUnit.html">CompositeUnit</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>u</em> </td><td>Unit to convert from. </td></tr>
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>mvalue</em> </td><td>Quantity value. </td></tr>
<tr><td valign="top"><tt>[in,out]</tt> </td><td valign="top"><em>exp</em> </td><td>Exponent. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true if the value was successfully converted.</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a26"></a><!-- doxytag: member=<Unit::isChildOf> ref=<a26> args=<(Unit *u) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool Unit::isChildOf </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classUnit.html">Unit</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>u</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
If specified unit is a base unit for this unit, directly or with other units in between. Equivalent to u->isParentOf(this).
<p>
Reimplemented in <a class="el" href="classAliasUnit.html#a25">AliasUnit</a>. </td>
</tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member=<Unit::isCurrency> ref=<a10> args=<() const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool Unit::isCurrency </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns if the unit is a currency (Euro is base unit).<p>
<dl compact><dt><b>Returns:</b></dt><dd>true if the unit is a currency.</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a27"></a><!-- doxytag: member=<Unit::isParentOf> ref=<a27> args=<(Unit *u) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool Unit::isParentOf </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classUnit.html">Unit</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>u</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
If this unit is a base unit for specified unit, directly or with other units in between. Equivalent to u->isChildOf(this).
<p>
Reimplemented in <a class="el" href="classAliasUnit.html#a26">AliasUnit</a>. </td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member=<Unit::isSIUnit> ref=<a6> args=<() const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">bool Unit::isSIUnit </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns if the unit is part of the SI standard.<p>
<dl compact><dt><b>Returns:</b></dt><dd>true if the unit is part of the SI standard.</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member=<Unit::print> ref=<a11> args=<(bool plural_, bool short_, bool use_unicode=false, bool(*can_display_unicode_string_function)(const char *, void *)=NULL, void *can_display_unicode_string_arg=NULL) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual string Unit::print </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">bool </td>
<td class="mdname" nowrap> <em>plural_</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>short_</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>use_unicode</em> = <code>false</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>bool(*)(const char *, void *) </td>
<td class="mdname" nowrap> <em>can_display_unicode_string_function</em> = <code>NULL</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void * </td>
<td class="mdname" nowrap> <em>can_display_unicode_string_arg</em> = <code>NULL</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">) </td>
<td class="md" colspan="2"> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns a display string representing the unit in an expression.<p>
Equivalent to <a class="el" href="classExpressionItem.html#a10">preferredName()</a> for Unit and <a class="el" href="classAliasUnit.html">AliasUnit</a>, but closer to MathStructure::print() for <a class="el" href="classCompositeUnit.html">CompositeUnit</a> (prints out base expression).
<p>
Reimplemented in <a class="el" href="classAliasUnit__Composite.html#a5">AliasUnit_Composite</a>, and <a class="el" href="classCompositeUnit.html#a12">CompositeUnit</a>. </td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member=<Unit::setAsSIUnit> ref=<a7> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void Unit::setAsSIUnit </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
State that the unit is part of the SI standard. Sets system to "SI". </td>
</tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member=<Unit::setSystem> ref=<a8> args=<(string s_system)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">void Unit::setSystem </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">string </td>
<td class="mdname1" valign="top" nowrap> <em>s_system</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Sets which system/standard ("SI", "SGC", etc.) the unit is part of. Setting system to "SI" (case-insensitive), is equivalent to <a class="el" href="classUnit.html#a7">setAsSIUnit()</a>. </td>
</tr>
</table>
<a class="anchor" name="a25"></a><!-- doxytag: member=<Unit::subtype> ref=<a25> args=<() const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual int Unit::subtype </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns the subtype of the unit, corresponding to which subsubclass the object belongs to.<p>
<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="Unit_8h.html#a3">UnitSubtype</a>.</dd></dl>
<p>
Implements <a class="el" href="classExpressionItem.html#a52">ExpressionItem</a>.
<p>
Reimplemented in <a class="el" href="classAliasUnit.html#a24">AliasUnit</a>, and <a class="el" href="classCompositeUnit.html#a13">CompositeUnit</a>. </td>
</tr>
</table>
<a class="anchor" name="a9"></a><!-- doxytag: member=<Unit::system> ref=<a9> args=<() const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">const string& Unit::system </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns the system/standard that the unit is part of.<p>
<dl compact><dt><b>Returns:</b></dt><dd>System string.</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="a24"></a><!-- doxytag: member=<Unit::type> ref=<a24> args=<() const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual int Unit::type </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
</td>
<td>
<p>
Returns the type of the expression item, corresponding to which subclass the object belongs to.<p>
<dl compact><dt><b>Returns:</b></dt><dd><a class="el" href="includes_8h.html#a254">ExpressionItemType</a>.</dd></dl>
<p>
Implements <a class="el" href="classExpressionItem.html#a51">ExpressionItem</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li>libqalculate/<a class="el" href="Unit_8h.html">Unit.h</a></ul>
<hr size="1"><address style="align: right;"><small>
Generated on 17 Jun 2007 for libqalculate-0.9.6 by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.3</small></address>
</body>
</html>
|