summaryrefslogtreecommitdiffstats
path: root/src/translators/pilotdb/libpalm/Database.cpp
blob: 38d896fc7dbc15a901f2313b0765dd79f8e8c746 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * palm-db-tools: General interface to a PalmOS database.
 * Copyright (C) 2000 by Tom Dyas ([email protected])
 *
 * This file implens an abstract interface to PalmOS
 * databases. Subclasses would include the class that reads/writes PDB
 * files and possibly databases that can be accessed over the HotSync
 * protocols.
 */

#include "palmtypes.h"
#include "Record.h"
#include "Database.h"

#ifndef __GNUG__

// MSVC: Visual C++ doesn't like initializers in the header ...
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_RESOURCE = 0x0001;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_READ_ONLY = 0x0002;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_APPINFO_DIRTY = 0x0004;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_BACKUP = 0x0008;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_OK_TO_INSTALL_NEWER = 0x0010;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_RESET_AFTER_INSTALL = 0x0020;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_COPY_PREVENTION = 0x0040;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_STREAM = 0x0080;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_HIDDEN = 0x0100;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_LAUNCHABLE_DATA = 0x0200;
const PalmLib::pi_uint16_t PalmLib::Database::FLAG_HDR_OPEN = 0x8000;
const PalmLib::pi_char_t PalmLib::Record::FLAG_ATTR_DELETED = 0x80;
const PalmLib::pi_char_t PalmLib::Record::FLAG_ATTR_DIRTY   = 0x40;
const PalmLib::pi_char_t PalmLib::Record::FLAG_ATTR_BUSY    = 0x20;
const PalmLib::pi_char_t PalmLib::Record::FLAG_ATTR_SECRET  = 0x10;

#endif

PalmLib::Database::Database(bool resourceDB)
    : m_name(""), m_version(0), m_time_created(0), m_time_modified(0),
      m_time_backup(0), m_modification(0), m_unique_id_seed(0)
{
    m_flags = resourceDB ? FLAG_HDR_RESOURCE : 0;
    m_type = PalmLib::mktag(' ', ' ', ' ', ' ');
    m_creator = PalmLib::mktag(' ', ' ', ' ', ' ');
}