scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
Loading...
Searching...
No Matches
Namespaces | Functions
direction.cpp File Reference
#include "./direction.hpp"
#include "boost/algorithm/string.hpp"
#include <sstream>
Include dependency graph for direction.cpp:

Go to the source code of this file.

Namespaces

namespace  scifir
 The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
 

Functions

direction::name scifir::create_direction (const string &x)
 
direction::name scifir::invert (direction::name x)
 
string scifir::to_string (direction::name x)
 
string scifir::to_string (const direction &x)
 
bool operator== (const scifir::direction &x, const scifir::direction &y)
 
bool operator!= (const scifir::direction &x, const scifir::direction &y)
 
bool operator== (const scifir::direction &x, scifir::direction::name y)
 
bool operator!= (const scifir::direction &x, scifir::direction::name y)
 
bool operator== (scifir::direction::name y, const scifir::direction &x)
 
bool operator!= (scifir::direction::name y, const scifir::direction &x)
 
bool operator== (const scifir::direction &x, const string &init_direction)
 
bool operator!= (const scifir::direction &x, const string &init_direction)
 
bool operator== (const string &init_direction, const scifir::direction &x)
 
bool operator!= (const string &init_direction, const scifir::direction &x)
 
void operator+= (string &x, const scifir::direction &y)
 
string operator+ (const string &x, const scifir::direction &y)
 
string operator+ (const scifir::direction &y, const string &x)
 
ostream & operator<< (ostream &os, const scifir::direction &x)
 
istream & operator>> (istream &is, scifir::direction &x)
 

Function Documentation

◆ operator!=() [1/5]

bool operator!= ( const scifir::direction x,
const scifir::direction y 
)

Definition at line 359 of file direction.cpp.

360{
361 return !(x == y);
362}

◆ operator!=() [2/5]

bool operator!= ( const scifir::direction x,
const string &  init_direction 
)

Definition at line 397 of file direction.cpp.

398{
399 return !(x == init_direction);
400}

◆ operator!=() [3/5]

bool operator!= ( const scifir::direction x,
scifir::direction::name  y 
)

Definition at line 376 of file direction.cpp.

377{
378 return !(x == y);
379}

◆ operator!=() [4/5]

bool operator!= ( const string &  init_direction,
const scifir::direction x 
)

Definition at line 408 of file direction.cpp.

409{
410 return !(init_direction == x);
411}

◆ operator!=() [5/5]

bool operator!= ( scifir::direction::name  y,
const scifir::direction x 
)

Definition at line 386 of file direction.cpp.

387{
388 return !(x == y);
389}

◆ operator+() [1/2]

string operator+ ( const scifir::direction y,
const string &  x 
)

Definition at line 428 of file direction.cpp.

429{
430 ostringstream output;
431 output << y;
432 output << x;
433 return output.str();
434}

◆ operator+() [2/2]

string operator+ ( const string &  x,
const scifir::direction y 
)

Definition at line 420 of file direction.cpp.

421{
422 ostringstream output;
423 output << x;
424 output << y;
425 return output.str();
426}

◆ operator+=()

void operator+= ( string &  x,
const scifir::direction y 
)

Definition at line 413 of file direction.cpp.

414{
415 ostringstream output;
416 output << y;
417 x += output.str();
418}

◆ operator<<()

ostream & operator<< ( ostream &  os,
const scifir::direction x 
)

Definition at line 436 of file direction.cpp.

437{
438 return os << to_string(x);
439}
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
Definition aid.cpp:582

◆ operator==() [1/5]

bool operator== ( const scifir::direction x,
const scifir::direction y 
)

Definition at line 347 of file direction.cpp.

348{
349 if(x.value == y.value)
350 {
351 return true;
352 }
353 else
354 {
355 return false;
356 }
357}
direction::name value
Definition direction.hpp:32

◆ operator==() [2/5]

bool operator== ( const scifir::direction x,
const string &  init_direction 
)

Definition at line 391 of file direction.cpp.

392{
393 scifir::direction y(init_direction);
394 return (x == y);
395}

◆ operator==() [3/5]

bool operator== ( const scifir::direction x,
scifir::direction::name  y 
)

Definition at line 364 of file direction.cpp.

365{
366 if(x.value == y)
367 {
368 return true;
369 }
370 else
371 {
372 return false;
373 }
374}

◆ operator==() [4/5]

bool operator== ( const string &  init_direction,
const scifir::direction x 
)

Definition at line 402 of file direction.cpp.

403{
404 scifir::direction y(init_direction);
405 return (x == y);
406}

◆ operator==() [5/5]

bool operator== ( scifir::direction::name  y,
const scifir::direction x 
)

Definition at line 381 of file direction.cpp.

382{
383 return (x == y);
384}

◆ operator>>()

istream & operator>> ( istream &  is,
scifir::direction x 
)

Definition at line 441 of file direction.cpp.

442{
443 char a[256];
444 is.getline(a, 256);
445 string b(a);
446 boost::trim(b);
447 x = scifir::direction(b);
448 return is;
449}