Commit ef858038 authored by Andrea Zoli's avatar Andrea Zoli
Browse files

Parsing directly XML without conversions.

parent 33b85ebe
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#define _FIELD_H_H

#include "PacketLibDefinition.h"
#include <string>

namespace PacketLib
{
@@ -42,7 +43,7 @@ public:
    int predefinedValue;

    /// Name of the field.
    char* name;
	std::string name;
	
	/// Logical type - NOT USED FOR NOW
	enum LogicalFieldDataType type;
@@ -56,7 +57,7 @@ class Field
public:

    /// Constructor of class.
    Field(char* name, char* dimension, char* predefinedValue, int progressiv);
    Field(std::string name, std::string dimension, std::string predefinedValue, int progressiv);

    /// Destructor of class.
    ~Field();
@@ -83,11 +84,17 @@ public:
    };

    /// Name of the field.
    inline char* getName()
    std::string getName()
    {
        return type->name;
        return type->name.c_str();
    };

	/// Return the logical field data type.
	LogicalFieldDataType getType()
	{
		return type->type;
	}

    inline int getProgressiv()
    {
        return progressiv;
+8 −6
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ public:
    /// Distruttore
    virtual ~Packet();

	void createPacketType(pugi::xml_document& doc, pugi::xml_node hNode, int plPhysicalIndex, int plSize, pugi::xml_node pNode, bool isprefix, word dimprefix, std::map<pugi::xml_node, int>& physicalIndex);

    virtual bool createPacketType(char* fileName, bool prefix, word dimprefix) throw (PacketException*);
	
	/// Decode the packet
@@ -174,16 +176,16 @@ public:
    ByteStreamPtr getOutputStream();
	
    /// Gets the name of packet.
    virtual char* getName()
    virtual const char* getName()
    {
        return name;
        return (char*) name.c_str();
    }

    
    /// The name of the file .packet that contains the structure of the packet
    virtual char* getFileName()
    virtual const char* getFileName()
    {
        return filename;
        return filename.c_str();
    }

    
@@ -289,7 +291,7 @@ protected:
    byte packetID;
    
    /// The name of the packet
    char* name;
    std::string name;
    
    /// List of identifiers. This identifiers permits to identify if the stream contains
    /// a particular type of packet
@@ -319,7 +321,7 @@ protected:
    bool thereisprefix;

    /// The name of the file .packet that contains the structure of the packet
    char* filename;
	std::string filename;

private:

+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ namespace PacketLib {
class PacketBufferQ {

public:
	PacketBufferQ(const string& configFile, const string& inputFile);
	PacketBufferQ(string configFile, string inputFile);

	~PacketBufferQ();

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ class PacketBufferV {

public:

	PacketBufferV(const string& configFile, const string& inputFile);
	PacketBufferV(string configFile, string inputFile);

	~PacketBufferV();

+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@ public:
        name = n;
    };

	void loadHeader(pugi::xml_node hNode, int plPhysicalIndex, int plSize);

    /// Loads data header from configuration file.
    bool loadHeader(char* fileName) throw(PacketException*);

Loading