00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __XPLC_CATEGORYNODE_H__
00023 #define __XPLC_CATEGORYNODE_H__
00024
00025 #include <string.h>
00026 #include <stdlib.h>
00027
00028 class CategoryEntryNode {
00029 public:
00030 CategoryEntryNode* next;
00031 UUID entry;
00032 char* str;
00033 CategoryEntryNode(const UUID& aUuid,
00034 const char* aStr,
00035 CategoryEntryNode* aNext): next(aNext),
00036 entry(aUuid),
00037 str(aStr ? strdup(aStr) : 0) {
00038 }
00039 ~CategoryEntryNode() {
00040 if(next)
00041 delete next;
00042
00043 if(str)
00044 free(str);
00045 }
00046 };
00047
00048 class CategoryNode {
00049 public:
00050 CategoryNode* next;
00051 UUID category;
00052 CategoryEntryNode* entries;
00053 CategoryNode(const UUID& aUuid,
00054 CategoryNode* aNext): next(aNext),
00055 category(aUuid),
00056 entries(0) {
00057 }
00058 ~CategoryNode() {
00059 if(entries)
00060 delete entries;
00061
00062 if(next)
00063 delete next;
00064 }
00065 };
00066
00067 #endif