Project

Profile

Help

How to connect?
Download (1.14 KB) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.8.0.14 / hec / Saxon.C.API / XdmItem.cpp @ 02f8308b

1

    
2

    
3
#include "XdmItem.h"
4

    
5
XdmItem::XdmItem(): XdmValue(){
6
        value = NULL;
7
}
8

    
9
    XdmItem::XdmItem(const XdmItem &other){
10
        value = (sxnc_value *)malloc(sizeof(sxnc_value));
11
        value->xdmvalue = other.value->xdmvalue;
12
        xdmSize =1;
13
        refCount = other.refCount;
14
    }
15

    
16

    
17
XdmItem::XdmItem(jobject obj){
18
        value = (sxnc_value *)malloc(sizeof(sxnc_value));
19
        value->xdmvalue = obj;
20
        xdmSize =1;
21
        refCount =1;
22
}
23

    
24
bool XdmItem::isAtomic(){
25
        return false;
26
}
27

    
28

    
29

    
30

    
31
   XdmItem * XdmItem::getHead(){ return this;}
32

    
33
  XdmItem * XdmItem::itemAt(int n){
34
        if (n < 0 || n >= size()) {
35
                return NULL;        
36
        }
37
        return this;
38
  }
39

    
40

    
41

    
42
 int XdmItem::size(){
43
        return 1;        
44
   }
45

    
46
jobject XdmItem::getUnderlyingValue(SaxonProcessor * proc){
47
#ifdef DEBUG
48
        std::cerr<<std::endl<<"XdmItem-getUnderlyingValue:"<<std::endl; 
49
#endif 
50
        if(value == NULL) {
51
                return NULL;        
52
        }
53
        return value->xdmvalue;
54
}
55

    
56
    const char * XdmItem::getStringValue(SaxonProcessor * proc1){ 
57
        if(proc != NULL && proc1 != NULL) {        
58
                proc = proc1;
59
        }
60
        if(proc != NULL) { 
61
                return proc->getStringValue(this);
62
        } else {
63
                return "";
64
        }
65
   }
66

    
67
        /**
68
        * Get the type of the object
69
        */
70
        XDM_TYPE XdmItem::getType(){
71
                return XDM_ITEM;
72
        }
(23-23/45)