Bitstream Interpretation Library (BIL)
0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
xdlrc
model
PIPDirection.cpp
Go to the documentation of this file.
1
6
#include <cstring>
7
#include <
exception/Exception.hpp
>
8
#include <
xdlrc/model/PIPDirection.hpp
>
9
10
using namespace
bil;
11
12
const
char
*
const
PIPDirection::MONODI_BUF_STRING
=
"->"
;
13
const
char
*
const
PIPDirection::BIDI_UNBUF_STRING
=
"=="
;
14
const
char
*
const
PIPDirection::BIDI_ONEBUF_STRING
=
"=>"
;
15
const
char
*
const
PIPDirection::BIDI_TWOBUF_STRING
=
"=-"
;
16
17
18
const
char
*
PIPDirection::toString
(
direction_t
dir)
19
{
20
switch
(dir)
21
{
22
case
MONODI_BUF
:
return
MONODI_BUF_STRING
;
23
case
BIDI_UNBUF
:
return
BIDI_UNBUF_STRING
;
24
case
BIDI_ONEBUF
:
return
BIDI_ONEBUF_STRING
;
25
case
BIDI_TWOBUF
:
return
BIDI_TWOBUF_STRING
;
26
default
:
return
0;
27
}
28
}
29
30
31
PIPDirection::direction_t
PIPDirection::fromString
(
const
char
* s)
32
{
33
if
(0 == strcmp(s,
MONODI_BUF_STRING
))
return
MONODI_BUF
;
34
if
(0 == strcmp(s,
BIDI_UNBUF_STRING
))
return
BIDI_UNBUF
;
35
if
(0 == strcmp(s,
BIDI_ONEBUF_STRING
))
return
BIDI_ONEBUF
;
36
if
(0 == strcmp(s,
BIDI_TWOBUF_STRING
))
return
BIDI_TWOBUF
;
37
throw
Exception
();
38
}
Generated on Wed Aug 8 2012 21:57:41 for Bitstream Interpretation Library (BIL) by
1.8.1.1