#include <iostream>
#include <stdexcept>
#include "func.h"
#include "element.h"
Go to the source code of this file.
Functions | |
void | setByteOrder (enum ByteOrder bo) |
Elements * | createElements (Element *element) |
Elements * | addElement (Elements *elements, Element *element) |
Element * | createElement (enum ComplexType type, Elements *elements, char *name) |
int | readNum (char *number) |
Element * | createDefinedElement (char *type, char *name, char *number) |
Element * | createSimpleElement (int type, char *name, char *number) |
void | processElement (enum ComplexType type, char *name, Elements *elements) |
Variables | |
enum ByteOrder | byteOrder = LittleEndian |
|
Definition at line 26 of file func.cpp. References Elements::Add().
00027 { 00028 elements->Add(element); 00029 return elements; 00030 } |
|
Definition at line 55 of file func.cpp. References ComplexElement::Find(), and readNum().
00056 { 00057 int n = readNum(number); 00058 00059 // find complex element 00060 ComplexElement *ce = ComplexElement::Find(type); 00061 free(type); 00062 00063 // !!! give some error 00064 if (!ce) 00065 throw std::runtime_error(""); 00066 00067 return new DefinedElement(name, ce, n); 00068 } |
|
Definition at line 33 of file func.cpp. References ComplexType.
00034 { 00035 Element *e = new ComplexElement(name,type,elements); 00036 free(name); 00037 return e; 00038 } |
|
Definition at line 18 of file func.cpp. References Elements::Add().
|
|
Definition at line 73 of file func.cpp. References readNum().
00074 { 00075 int n = readNum(number); 00076 00077 Element* res; 00078 if (type==0) 00079 res = new PaddingElement(name,n==0?1:n); 00080 else 00081 res = new SimpleElement(name,type<0,type<0?-type:type,n); 00082 free(name); 00083 return res; 00084 } |
|
Definition at line 87 of file func.cpp. References ComplexType, and ComplexElement::Process().
00088 { 00089 ComplexElement *ce = new ComplexElement(name,type,elements); 00090 free(name); 00091 00092 ce->Process(cout); 00093 } |
|
Definition at line 42 of file func.cpp. Referenced by createDefinedElement(), and createSimpleElement().
00043 { 00044 int n = 0; 00045 if (number) 00046 { 00047 n = atoi(number); 00048 free(number); 00049 } 00050 return n; 00051 } |
|
Definition at line 9 of file func.cpp. References ByteOrder, and byteOrder.
00010 { 00011 byteOrder = bo; 00012 } |
|
Definition at line 6 of file func.cpp. Referenced by setByteOrder(). |