images/plugin_impl/marker_entry_impl.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "marker_entry_impl.h"
00028 #include "log.h"
00029 #include <string.h>
00030
00031 namespace images
00032 {
00033
00034 MarkerEntry* marker_entry_new(unsigned int uds_private_size)
00035 {
00036 unsigned int marker_entry_size = sizeof(MarkerEntry) + uds_private_size;
00037 char* p = new char[marker_entry_size];
00038 memset(p, 0, marker_entry_size);
00039
00040 MarkerEntry* marker_entry = reinterpret_cast<MarkerEntry *>(p);
00041 marker_entry->type = MARKER_UDS_PRIVATE;
00042 return marker_entry;
00043 }
00044
00045 void marker_entry_free_recursive(MarkerEntry* self)
00046 {
00047 if (self->first_child)
00048 {
00049 marker_entry_free_recursive(self->first_child);
00050 self->first_child = 0;
00051 }
00052
00053 if (self->sibling)
00054 {
00055 marker_entry_free_recursive(self->sibling);
00056 self->sibling = 0;
00057 }
00058
00059 if (self->anchor)
00060 {
00061 StringImpl* p = static_cast<StringImpl *>(self->anchor);
00062 delete p;
00063 self->anchor = 0;
00064 }
00065
00066 if (self->text)
00067 {
00068 StringImpl* p = static_cast<StringImpl *>(self->text);
00069 delete p;
00070 self->text = 0;
00071 }
00072 }
00073
00074 }