1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent tw=79 ft=cpp: */
4 * Copyright (C) 2008 Sergey Yanovich <ynvich@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef AALOADBUILDER_H
23 #define AALOADBUILDER_H 1
25 #include "aaIChartHandler.h"
29 class aaILoadObserver
;
32 class mozIStorageValueArray
;
34 #include "aaIDataNode.h"
35 #include "mozIStorageValueArray.h"
38 #define AA_LOADBUILDER_CID \
39 {0xb1be92d1, 0xdd70, 0x496a, {0xaa, 0xa9, 0xa4, 0x0f, 0x7e, 0x5b, 0x94, 0x12}}
41 #define AA_BUILD_BUFFER_SIZE 1024
43 class aaLoadBuilder
: public aaIChartHandler
46 aaLoadBuilder() :mIndex(0) {}
49 NS_DECL_AAICHARTHANDLER
51 nsresult
Load(aaISqlResult
*result
, aaIDataNode
**_retval
);
53 virtual ~aaLoadBuilder() {}
55 char mPrefix
[AA_BUILD_BUFFER_SIZE
];
57 nsCOMPtr
<aaIDataNode
> mResult
;
61 PrefixStacker(aaLoadBuilder
*parent
)
62 :mParent(parent
), mIndex(parent
? parent
->mIndex
: 0) {}
64 { ResetPrefix(); mParent
= nsnull
; }
65 PRUint32
GetIndex() const { return mIndex
; }
69 mParent
->mPrefix
[mIndex
] = 0;
70 mParent
->mIndex
= mIndex
;
71 mParent
->mResult
= nsnull
;
75 aaLoadBuilder
*mParent
;
79 nsresult
appendPrefix(const char *aElement
);
80 PRUint32
getColumn(const char *aElement
);
83 #endif /* AALOADBUILDER_H */