barry.h   barry.h 
/// ///
/// \file barry.h /// \file barry.h
/// Main header file for applications /// Main header file for applications
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 58 skipping to change at line 58
#include "usbwrap.h" // to be moved to libusb someday #include "usbwrap.h" // to be moved to libusb someday
#include "common.h" // Init() #include "common.h" // Init()
#include "error.h" // exceptions #include "error.h" // exceptions
#include "probe.h" // device prober class #include "probe.h" // device prober class
#include "dataqueue.h" #include "dataqueue.h"
#include "socket.h" #include "socket.h"
#include "router.h" #include "router.h"
#include "protocol.h" // application-safe header #include "protocol.h" // application-safe header
#include "parser.h" #include "parser.h"
#include "builder.h" #include "builder.h"
#include "record.h"
#include "ldif.h" #include "ldif.h"
#include "controller.h" #include "controller.h"
#include "m_desktop.h" #include "m_desktop.h"
#include "m_desktoptmpl.h"
#include "m_ipmodem.h" #include "m_ipmodem.h"
#include "m_serial.h" #include "m_serial.h"
#include "m_javaloader.h"
#include "version.h" #include "version.h"
#include "log.h" #include "log.h"
#include "sha1.h" #include "sha1.h"
#include "iconv.h"
#include "bmp.h"
#include "cod.h"
#include "record.h"
// Include the template helpers after the record classes
#include "m_desktoptmpl.h"
#ifdef __BARRY_BOOST_MODE__ #ifdef __BARRY_BOOST_MODE__
// Boost serialization seems to be picky about header order, do them all he re // Boost serialization seems to be picky about header order, do them all he re
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <vector> #include <vector>
#include <string> #include <string>
#include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_oarchive.hpp>
 End of changes. 5 change blocks. 
3 lines changed or deleted 9 lines changed or added


 builder.h   builder.h 
/// ///
/// \file builder.h /// \file builder.h
/// Virtual protocol packet builder wrapper /// Virtual protocol packet builder wrapper
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 29 skipping to change at line 29
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_BUILDER_H__ #ifndef __BARRY_BUILDER_H__
#define __BARRY_BUILDER_H__ #define __BARRY_BUILDER_H__
#include "dll.h" #include "dll.h"
namespace Barry { namespace Barry {
// forward declarations
class IConverter;
// //
// Builder class // Builder class
// //
/// Base class for the builder functor hierarchy. /// Base class for the builder functor hierarchy.
/// ///
/// This defines the API used by the Controller and Packet classes /// This defines the API used by the Controller and Packet classes
/// for building a raw device record to write to the device. /// for building a raw device record to write to the device.
/// ///
class BXEXPORT Builder class BXEXPORT Builder
{ {
skipping to change at line 62 skipping to change at line 65
/// Called before BuildFields() in order to build the header /// Called before BuildFields() in order to build the header
/// for this record. Store the raw data in data, at the /// for this record. Store the raw data in data, at the
/// offset given in offset. When finished, update offset to /// offset given in offset. When finished, update offset to
/// point to the next spot to put new data. /// point to the next spot to put new data.
virtual void BuildHeader(Data &data, size_t &offset) = 0; virtual void BuildHeader(Data &data, size_t &offset) = 0;
/// Called to build the record field data. Store the raw data /// Called to build the record field data. Store the raw data
/// in data, using offset to know where to write. Be sure to /// in data, using offset to know where to write. Be sure to
/// update offset, and be sure to adjust the size of the data /// update offset, and be sure to adjust the size of the data
/// packet (possibly with Data::ReleaseBuffer()). /// packet (possibly with Data::ReleaseBuffer()).
virtual void BuildFields(Data &data, size_t &offset) = 0; virtual void BuildFields(Data &data, size_t &offset,
const IConverter *ic) = 0;
}; };
// //
// RecordBuilder template class // RecordBuilder template class
// //
/// Template class for easy creation of specific protocol packet builder /// Template class for easy creation of specific protocol packet builder
/// objects. This template takes the following template arguments: /// objects. This template takes the following template arguments:
/// ///
/// - RecordT: One of the record classes in record.h /// - RecordT: One of the record classes in record.h
/// - StorageT: A custom storage functor class. An object of this type /// - StorageT: A custom storage functor class. An object of this type
skipping to change at line 132 skipping to change at line 136
return m_rec.GetUniqueId(); return m_rec.GetUniqueId();
} }
/// Functor member called by Controller::SaveDatabase() during /// Functor member called by Controller::SaveDatabase() during
/// processing. /// processing.
virtual void BuildHeader(Data &data, size_t &offset) virtual void BuildHeader(Data &data, size_t &offset)
{ {
m_rec.BuildHeader(data, offset); m_rec.BuildHeader(data, offset);
} }
virtual void BuildFields(Data &data, size_t &offset) virtual void BuildFields(Data &data, size_t &offset, const IConverte r *ic)
{ {
m_rec.BuildFields(data, offset); m_rec.BuildFields(data, offset, ic);
} }
}; };
// //
// RecordFetch template class // RecordFetch template class
// //
/// Generic record fetch class, to help with using records without /// Generic record fetch class, to help with using records without
/// builder classes. /// builder classes.
/// ///
template <class RecordT> template <class RecordT>
 End of changes. 5 change blocks. 
4 lines changed or deleted 8 lines changed or added


 common.h   common.h 
/// ///
/// \file common.h /// \file common.h
/// General header for the Barry library /// General header for the Barry library
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 31 skipping to change at line 31
#ifndef __BARRY_COMMON_H__ #ifndef __BARRY_COMMON_H__
#define __BARRY_COMMON_H__ #define __BARRY_COMMON_H__
#include "dll.h" #include "dll.h"
#include <iostream> #include <iostream>
#define VENDOR_RIM 0x0fca #define VENDOR_RIM 0x0fca
#define PRODUCT_RIM_BLACKBERRY 0x0001 #define PRODUCT_RIM_BLACKBERRY 0x0001
#define PRODUCT_RIM_PEARL_DUAL 0x0004 #define PRODUCT_RIM_PEARL_DUAL 0x0004
#define PRODUCT_RIM_PEARL_FLIP 0x8001 // 8200 series
#define PRODUCT_RIM_PEARL_8120 0x8004 #define PRODUCT_RIM_PEARL_8120 0x8004
#define PRODUCT_RIM_PEARL 0x0006 #define PRODUCT_RIM_PEARL 0x0006
#define PRODUCT_RIM_STORM 0x8007
#define BLACKBERRY_INTERFACE 0
#define BLACKBERRY_CONFIGURATION 1 #define BLACKBERRY_CONFIGURATION 1
#define BLACKBERRY_DB_CLASS 0xff #define BLACKBERRY_DB_CLASS 0xff
#define IPRODUCT_RIM_HANDHELD 2
#define IPRODUCT_RIM_MASS_STORAGE 4
#define IPRODUCT_RIM_COMPOSITE 5
// minimum number of password tries remaining at which Barry gives up // minimum number of password tries remaining at which Barry gives up
// for safety // for safety
#define BARRY_MIN_PASSWORD_TRIES 3 #define BARRY_MIN_PASSWORD_TRIES 3
#define BARRY_MIN_PASSWORD_TRIES_ASC "3" #define BARRY_MIN_PASSWORD_TRIES_ASC "3"
#define BLACKBERRY_CHARSET "WINDOWS-1252"
namespace Barry { namespace Barry {
/// See also the LogLock class. /// See also the LogLock class.
BXEXPORT void Init(bool data_dump_mode = false, std::ostream *logStream = & std::cout); BXEXPORT void Init(bool data_dump_mode = false, std::ostream *logStream = & std::cout);
} // namespace Barry } // namespace Barry
#endif #endif
 End of changes. 6 change blocks. 
1 lines changed or deleted 10 lines changed or added


 controller.h   controller.h 
/// ///
/// \file controller.h /// \file controller.h
/// High level BlackBerry API class /// High level BlackBerry API class
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 39 skipping to change at line 39
/// Project namespace, containing all related functions and classes. /// Project namespace, containing all related functions and classes.
/// This is the only namespace applications should be concerned with, /// This is the only namespace applications should be concerned with,
/// for now. /// for now.
namespace Barry { namespace Barry {
// forward declarations // forward declarations
class SocketRoutingQueue; class SocketRoutingQueue;
namespace Mode { namespace Mode {
class Desktop; class Mode;
class IpModem; class IpModem;
class Serial; class Serial;
class JavaLoader;
} }
// //
// Controller class // Controller class
// //
/// The main interface class. This class coordinates the communication to /// The main interface class. This class coordinates the communication to
/// a single handheld. This class also owns the only Usb::Device object /// a single handheld. This class also owns the only Usb::Device object
/// the handheld. All other classes reference this one for the low level /// the handheld. All other classes reference this one for the low level
/// device object. This class owns the only SocketZero object as well, /// device object. This class owns the only SocketZero object as well,
/// which is the object that any SocketRoutingQueue is plugged into /// which is the object that any SocketRoutingQueue is plugged into
skipping to change at line 69 skipping to change at line 70
/// - Pass one of the probe results into the Controller constructor /// - Pass one of the probe results into the Controller constructor
/// to connect to the USB device. Pass the routing queue /// to connect to the USB device. Pass the routing queue
/// to the Controller constructor here too, if needed. /// to the Controller constructor here too, if needed.
/// - Create the Mode object of your choice. See m_desktop.h /// - Create the Mode object of your choice. See m_desktop.h
/// and m_serial.h for these mode classes. You pass /// and m_serial.h for these mode classes. You pass
/// your controller object into these mode constructors /// your controller object into these mode constructors
/// to create the mode. /// to create the mode.
/// ///
class BXEXPORT Controller class BXEXPORT Controller
{ {
friend class Barry::Mode::Desktop; friend class Barry::Mode::Mode;
friend class Barry::Mode::IpModem; friend class Barry::Mode::IpModem;
friend class Barry::Mode::Serial; friend class Barry::Mode::Serial;
friend class Barry::Mode::JavaLoader;
public: public:
/// Handheld mode type /// Handheld mode type
enum ModeType { enum ModeType {
Unspecified, //< default on start up (unused) Unspecified, //< default on start up (unused)
Bypass, //< unsupported, unknown Bypass, //< unsupported, unknown
Desktop, //< desktop mode required for databa se Desktop, //< desktop mode required for databa se
//< operation //< operation
JavaLoader, //< unsupported JavaLoader, //< experimental
UsbSerData, //< GPRS modem support over USB UsbSerData, //< GPRS modem support over USB
UsbSerCtrl //< internally used behind the scene s UsbSerCtrl //< internally used behind the scene s
}; };
private: private:
ProbeResult m_result; ProbeResult m_result;
Usb::Device m_dev; Usb::Device m_dev;
Usb::Interface *m_iface; Usb::Interface *m_iface;
uint32_t m_pin; uint32_t m_pin;
 End of changes. 6 change blocks. 
4 lines changed or deleted 6 lines changed or added


 data.h   data.h 
/// ///
/// \file data.h /// \file data.h
/// Class to deal with pre-saved data files /// Class to deal with pre-saved data files
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 71 skipping to change at line 71
const unsigned char * GetData() const { return m_external ? m_extern alData : m_data; } const unsigned char * GetData() const { return m_external ? m_extern alData : m_data; }
size_t GetSize() const { return m_datasize; } size_t GetSize() const { return m_datasize; }
unsigned char * GetBuffer(size_t requiredsize = 0); unsigned char * GetBuffer(size_t requiredsize = 0);
size_t GetBufSize() const { return m_bufsize; } size_t GetBufSize() const { return m_bufsize; }
void ReleaseBuffer(int datasize = -1); void ReleaseBuffer(int datasize = -1);
void AppendHexString(const char *str); void AppendHexString(const char *str);
void Zap(); /// set buffer to 0 size, but don't bother overwriting memory with 0
void QuickZap() { m_datasize = 0; }
void Zap(); // does a memset too
Data& operator=(const Data &other); Data& operator=(const Data &other);
// static functions // static functions
static void PrintAscii(bool setting) { bPrintAscii = setting; } static void PrintAscii(bool setting) { bPrintAscii = setting; }
static bool PrintAscii() { return bPrintAscii; } static bool PrintAscii() { return bPrintAscii; }
}; };
BXEXPORT std::istream& operator>> (std::istream &is, Data &data); BXEXPORT std::istream& operator>> (std::istream &is, Data &data);
BXEXPORT std::ostream& operator<< (std::ostream &os, const Data &data); BXEXPORT std::ostream& operator<< (std::ostream &os, const Data &data);
 End of changes. 2 change blocks. 
2 lines changed or deleted 4 lines changed or added


 dataqueue.h   dataqueue.h 
/// ///
/// \file dataqueue.h /// \file dataqueue.h
/// FIFO queue of Data objects /// FIFO queue of Data objects
/// ///
/* /*
Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 dll.h   dll.h 
/// ///
/// \file dll.h /// \file dll.h
/// Macros for handling DLL/library API visibility /// Macros for handling DLL/library API visibility
/// ///
/// Based on documentation at: http://gcc.gnu.org/wiki/Visibility /// Based on documentation at: http://gcc.gnu.org/wiki/Visibility
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 error.h   error.h 
/// ///
/// \file error.h /// \file error.h
/// Common exception classes for the Barry library /// Common exception classes for the Barry library
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_ERROR_H__ #ifndef __BARRY_ERROR_H__
#define __BARRY_ERROR_H__ #define __BARRY_ERROR_H__
#include "dll.h" #include "dll.h"
#include <stdexcept> #include <stdexcept>
#include <stdint.h>
namespace Barry { namespace Barry {
/// \addtogroup exceptions /// \addtogroup exceptions
/// @{ /// @{
// //
// Error class // Error class
// //
/// The base class for any future derived exceptions. /// The base class for any future derived exceptions.
skipping to change at line 100 skipping to change at line 101
// BadSize // BadSize
// //
/// Unexpected packet size, or not enough data. /// Unexpected packet size, or not enough data.
/// ///
class BXEXPORT BadSize : public Barry::Error class BXEXPORT BadSize : public Barry::Error
{ {
unsigned int m_packet_size, unsigned int m_packet_size,
m_data_buf_size, m_data_buf_size,
m_required_size; m_required_size;
BXLOCAL static std::string GetMsg(const char *msg, unsigned int d, u nsigned int r);
BXLOCAL static std::string GetMsg(unsigned int p, unsigned int d, un signed int r); BXLOCAL static std::string GetMsg(unsigned int p, unsigned int d, un signed int r);
public: public:
BadSize(const char *msg, unsigned int data_size, unsigned int requir
ed_size)
: Barry::Error(GetMsg(msg, data_size, required_size))
, m_packet_size(0)
, m_data_buf_size(data_size)
, m_required_size(required_size)
{}
BadSize(unsigned int packet_size, BadSize(unsigned int packet_size,
unsigned int data_buf_size, unsigned int data_buf_size,
unsigned int required_size) unsigned int required_size)
: Barry::Error(GetMsg(packet_size, data_buf_size, required_s : Barry::Error(GetMsg(packet_size, data_buf_size, required_s
ize)), ize))
m_packet_size(packet_size), , m_packet_size(packet_size)
m_data_buf_size(data_buf_size), , m_data_buf_size(data_buf_size)
m_required_size(required_size) , m_required_size(required_size)
{} {}
unsigned int packet_size() const { return m_packet_size; } unsigned int packet_size() const { return m_packet_size; }
unsigned int data_buf_size() const { return m_data_buf_size; } unsigned int data_buf_size() const { return m_data_buf_size; }
unsigned int required_size() const { return m_required_size; } unsigned int required_size() const { return m_required_size; }
}; };
// //
// ErrnoError // ErrnoError
// //
/// System error that provides an errno error code. /// System error that provides an errno error code.
/// ///
class ErrnoError : public Barry::Error class BXEXPORT ErrnoError : public Barry::Error
{ {
int m_errno; int m_errno;
static std::string GetMsg(const std::string &msg, int err); static std::string GetMsg(const std::string &msg, int err);
public: public:
ErrnoError(const std::string &msg, int err) ErrnoError(const std::string &msg, int err)
: Barry::Error(GetMsg(msg, err)) : Barry::Error(GetMsg(msg, err))
, m_errno(err) , m_errno(err)
{} {}
int error_code() const { return m_errno; } int error_code() const { return m_errno; }
}; };
//
// BadPackedFormat
//
/// Thrown by record classes that don't recognize a given packed format cod
e.
/// This exception is mostly handled internally, but is published here
/// just in case it escapes.
///
class BXEXPORT BadPackedFormat : public Barry::Error
{
uint8_t m_format;
public:
BadPackedFormat(uint8_t format)
: Barry::Error("Bad packed format - internal exception")
, m_format(format)
{}
uint8_t format() const { return m_format; }
};
//
// BadPacket
//
/// Thrown by the socket class if a packet command's response indicates
/// an error. Some commands may be able to recover inside the library,
/// so a special exception is used, that includes the response code.
///
class BXEXPORT BadPacket : public Barry::Error
{
uint8_t m_response;
public:
BadPacket(uint8_t response, const std::string &msg)
: Barry::Error(msg)
, m_response(response)
{}
uint8_t response() const { return m_response; }
};
/// @} /// @}
} // namespace Barry } // namespace Barry
#endif #endif
 End of changes. 7 change blocks. 
7 lines changed or deleted 57 lines changed or added


 ldif.h   ldif.h 
/// ///
/// \file ldif.h /// \file ldif.h
/// Routines for reading and writing LDAP LDIF data. /// Routines for reading and writing LDAP LDIF data.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 168 skipping to change at line 168
virtual std::string Fax(const Barry::Contact &con) const; virtual std::string Fax(const Barry::Contact &con) const;
virtual std::string WorkPhone(const Barry::Contact &con) const; virtual std::string WorkPhone(const Barry::Contact &con) const;
virtual std::string HomePhone(const Barry::Contact &con) const; virtual std::string HomePhone(const Barry::Contact &con) const;
virtual std::string MobilePhone(const Barry::Contact &con) const; virtual std::string MobilePhone(const Barry::Contact &con) const;
virtual std::string Pager(const Barry::Contact &con) const; virtual std::string Pager(const Barry::Contact &con) const;
virtual std::string PIN(const Barry::Contact &con) const; virtual std::string PIN(const Barry::Contact &con) const;
virtual std::string FirstName(const Barry::Contact &con) const; virtual std::string FirstName(const Barry::Contact &con) const;
virtual std::string LastName(const Barry::Contact &con) const; virtual std::string LastName(const Barry::Contact &con) const;
virtual std::string Company(const Barry::Contact &con) const; virtual std::string Company(const Barry::Contact &con) const;
virtual std::string DefaultCommunicationsMethod(const Barry::Contact &con) const; virtual std::string DefaultCommunicationsMethod(const Barry::Contact &con) const;
virtual std::string Address1(const Barry::Contact &con) const; virtual std::string WorkAddress1(const Barry::Contact &con) const;
virtual std::string Address2(const Barry::Contact &con) const; virtual std::string WorkAddress2(const Barry::Contact &con) const;
virtual std::string Address3(const Barry::Contact &con) const; virtual std::string WorkAddress3(const Barry::Contact &con) const;
virtual std::string City(const Barry::Contact &con) const; virtual std::string WorkCity(const Barry::Contact &con) const;
virtual std::string Province(const Barry::Contact &con) const; virtual std::string WorkProvince(const Barry::Contact &con) const;
virtual std::string PostalCode(const Barry::Contact &con) const; virtual std::string WorkPostalCode(const Barry::Contact &con) const;
virtual std::string Country(const Barry::Contact &con) const; virtual std::string WorkCountry(const Barry::Contact &con) const;
virtual std::string JobTitle(const Barry::Contact &con) const; virtual std::string JobTitle(const Barry::Contact &con) const;
virtual std::string PublicKey(const Barry::Contact &con) const; virtual std::string PublicKey(const Barry::Contact &con) const;
virtual std::string Notes(const Barry::Contact &con) const; virtual std::string Notes(const Barry::Contact &con) const;
// calculated values... // calculated values...
virtual std::string PostalAddress(const Barry::Contact &con) const; virtual std::string WorkPostalAddress(const Barry::Contact &con) con
st;
virtual std::string HomePostalAddress(const Barry::Contact &con) con
st;
virtual std::string FullName(const Barry::Contact &con) const; virtual std::string FullName(const Barry::Contact &con) const;
virtual std::string FQDN(const Barry::Contact &con) const; virtual std::string FQDN(const Barry::Contact &con) const;
// //
// Array modifier functions for above Access functions // Array modifier functions for above Access functions
// //
virtual bool IsArrayFunc(GetFunctionType getf) const; virtual bool IsArrayFunc(GetFunctionType getf) const;
void ClearArrayState() const; void ClearArrayState() const;
skipping to change at line 206 skipping to change at line 207
virtual void SetFax(Barry::Contact &con, const std::string &val) con st; virtual void SetFax(Barry::Contact &con, const std::string &val) con st;
virtual void SetWorkPhone(Barry::Contact &con, const std::string &va l) const; virtual void SetWorkPhone(Barry::Contact &con, const std::string &va l) const;
virtual void SetHomePhone(Barry::Contact &con, const std::string &va l) const; virtual void SetHomePhone(Barry::Contact &con, const std::string &va l) const;
virtual void SetMobilePhone(Barry::Contact &con, const std::string & val) const; virtual void SetMobilePhone(Barry::Contact &con, const std::string & val) const;
virtual void SetPager(Barry::Contact &con, const std::string &val) c onst; virtual void SetPager(Barry::Contact &con, const std::string &val) c onst;
virtual void SetPIN(Barry::Contact &con, const std::string &val) con st; virtual void SetPIN(Barry::Contact &con, const std::string &val) con st;
virtual void SetFirstName(Barry::Contact &con, const std::string &va l) const; virtual void SetFirstName(Barry::Contact &con, const std::string &va l) const;
virtual void SetLastName(Barry::Contact &con, const std::string &val ) const; virtual void SetLastName(Barry::Contact &con, const std::string &val ) const;
virtual void SetCompany(Barry::Contact &con, const std::string &val) const; virtual void SetCompany(Barry::Contact &con, const std::string &val) const;
virtual void SetDefaultCommunicationsMethod(Barry::Contact &con, con st std::string &val) const; virtual void SetDefaultCommunicationsMethod(Barry::Contact &con, con st std::string &val) const;
virtual void SetAddress1(Barry::Contact &con, const std::string &val virtual void SetWorkAddress1(Barry::Contact &con, const std::string
) const; &val) const;
virtual void SetAddress2(Barry::Contact &con, const std::string &val virtual void SetWorkAddress2(Barry::Contact &con, const std::string
) const; &val) const;
virtual void SetAddress3(Barry::Contact &con, const std::string &val virtual void SetWorkAddress3(Barry::Contact &con, const std::string
) const; &val) const;
virtual void SetCity(Barry::Contact &con, const std::string &val) co virtual void SetWorkCity(Barry::Contact &con, const std::string &val
nst; ) const;
virtual void SetProvince(Barry::Contact &con, const std::string &val virtual void SetWorkProvince(Barry::Contact &con, const std::string
) const; &val) const;
virtual void SetPostalCode(Barry::Contact &con, const std::string &v virtual void SetWorkPostalCode(Barry::Contact &con, const std::strin
al) const; g &val) const;
virtual void SetCountry(Barry::Contact &con, const std::string &val) virtual void SetWorkCountry(Barry::Contact &con, const std::string &
const; val) const;
virtual void SetJobTitle(Barry::Contact &con, const std::string &val ) const; virtual void SetJobTitle(Barry::Contact &con, const std::string &val ) const;
virtual void SetPublicKey(Barry::Contact &con, const std::string &va l) const; virtual void SetPublicKey(Barry::Contact &con, const std::string &va l) const;
virtual void SetNotes(Barry::Contact &con, const std::string &val) c onst; virtual void SetNotes(Barry::Contact &con, const std::string &val) c onst;
virtual void SetPostalAddress(Barry::Contact &con, const std::string virtual void SetWorkPostalAddress(Barry::Contact &con, const std::st
&val) const; ring &val) const;
virtual void SetHomePostalAddress(Barry::Contact &con, const std::st
ring &val) const;
virtual void SetFullName(Barry::Contact &con, const std::string &val ) const; virtual void SetFullName(Barry::Contact &con, const std::string &val ) const;
virtual void SetFQDN(Barry::Contact &con, const std::string &val) co nst; virtual void SetFQDN(Barry::Contact &con, const std::string &val) co nst;
// //
// Name heuristics // Name heuristics
// //
virtual void ClearHeuristics(); virtual void ClearHeuristics();
virtual bool RunHeuristics(Barry::Contact &con); virtual bool RunHeuristics(Barry::Contact &con);
 End of changes. 5 change blocks. 
25 lines changed or deleted 30 lines changed or added


 log.h   log.h 
/// ///
/// \file log.h /// \file log.h
/// General header for the Barry library /// General header for the Barry library
/// ///
/* /*
Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 m_desktop.h   m_desktop.h 
/// ///
/// \file m_desktop.h /// \file m_desktop.h
/// Mode class for the Desktop mode /// Mode class for the Desktop mode
/// ///
/* /*
Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_M_DESKTOP_H__ #ifndef __BARRY_M_DESKTOP_H__
#define __BARRY_M_DESKTOP_H__ #define __BARRY_M_DESKTOP_H__
#include "dll.h" #include "dll.h"
#include "m_mode_base.h"
#include "socket.h" #include "socket.h"
#include "record.h" #include "record.h"
namespace Barry { namespace Barry {
// forward declarations // forward declarations
class Parser; class Parser;
class Builder; class Builder;
class Controller; class IConverter;
namespace Mode { namespace Mode {
// //
// Desktop class // Desktop class
// //
/// The main interface class to the device databases. /// The main interface class to the device databases.
/// ///
/// To use this class, use the following steps: /// To use this class, use the following steps:
/// ///
/// - Create a Controller object (see Controller class for more details) /// - Create a Controller object (see Controller class for more details)
/// - Create this Mode::Desktop object, passing in the Controller /// - Create this Mode::Desktop object, passing in the Controller
/// object during construction /// object during construction
/// - Call Open() to open database socket and finish constructing. /// - Call Open() to open database socket and finish constructing.
/// - Call GetDBDB() to get the device's database database /// - Call GetDBDB() to get the device's database database
/// - Call GetDBID() to get a database ID by name /// - Call GetDBID() to get a database ID by name
/// - Call LoadDatabase() to retrieve and store a database /// - Call LoadDatabase() to retrieve and store a database
/// ///
class BXEXPORT Desktop class BXEXPORT Desktop : public Mode
{ {
public: public:
enum CommandType { Unknown, DatabaseAccess }; enum CommandType { Unknown, DatabaseAccess };
private: private:
Controller &m_con;
SocketHandle m_socket;
CommandTable m_commandTable; CommandTable m_commandTable;
DatabaseDatabase m_dbdb; DatabaseDatabase m_dbdb;
uint16_t m_ModeSocket; // socket recommended by dev // external objects (optional, can be null)
ice const IConverter *m_ic;
// when mode was selected
protected: protected:
void LoadCommandTable(); void LoadCommandTable();
void LoadDBDB(); void LoadDBDB();
//////////////////////////////////
// overrides
virtual void OnOpen();
public: public:
Desktop(Controller &con); Desktop(Controller &con);
Desktop(Controller &con, const IConverter &ic);
~Desktop(); ~Desktop();
////////////////////////////////// //////////////////////////////////
// primary operations - required before anything else
void Open(const char *password = 0);
void RetryPassword(const char *password);
//////////////////////////////////
// meta access // meta access
/// Returns DatabaseDatabase object for this connection. /// Returns DatabaseDatabase object for this connection.
/// Must call Open() first, which loads the DBDB. /// Must call Open() first, which loads the DBDB.
const DatabaseDatabase& GetDBDB() const { return m_dbdb; } const DatabaseDatabase& GetDBDB() const { return m_dbdb; }
unsigned int GetDBID(const std::string &name) const; unsigned int GetDBID(const std::string &name) const;
unsigned int GetDBCommand(CommandType ct); unsigned int GetDBCommand(CommandType ct);
void SetIConverter(const IConverter &ic);
////////////////////////////////// //////////////////////////////////
// Desktop mode - database specific // Desktop mode - database specific
// dirty flag related functions, for sync operations // dirty flag related functions, for sync operations
void GetRecordStateTable(unsigned int dbId, RecordStateTable &result ); void GetRecordStateTable(unsigned int dbId, RecordStateTable &result );
void AddRecord(unsigned int dbId, Builder &build); // RecordId is void AddRecord(unsigned int dbId, Builder &build); // RecordId is
// retrieved from build, and duplicate IDs are allowed, // retrieved from build, and duplicate IDs are allowed,
// but *not* recommended! // but *not* recommended!
void GetRecord(unsigned int dbId, unsigned int stateTableIndex, Pars er &parser); void GetRecord(unsigned int dbId, unsigned int stateTableIndex, Pars er &parser);
void SetRecord(unsigned int dbId, unsigned int stateTableIndex, Buil der &build); void SetRecord(unsigned int dbId, unsigned int stateTableIndex, Buil der &build);
void ClearDirty(unsigned int dbId, unsigned int stateTableIndex); void ClearDirty(unsigned int dbId, unsigned int stateTableIndex);
void DeleteRecord(unsigned int dbId, unsigned int stateTableIndex); void DeleteRecord(unsigned int dbId, unsigned int stateTableIndex);
// pure load/save operations // pure load/save operations
void LoadDatabase(unsigned int dbId, Parser &parser); void LoadDatabase(unsigned int dbId, Parser &parser);
void ClearDatabase(unsigned int dbId);
void SaveDatabase(unsigned int dbId, Builder &builder); void SaveDatabase(unsigned int dbId, Builder &builder);
template <class RecordT, class StorageT> void LoadDatabaseByType(Sto rageT &store); template <class RecordT, class StorageT> void LoadDatabaseByType(Sto rageT &store);
template <class RecordT, class StorageT> void SaveDatabaseByType(Sto rageT &store); template <class RecordT, class StorageT> void SaveDatabaseByType(Sto rageT &store);
template <class StorageT> void LoadDatabaseByName(const std::string &name, StorageT &store); template <class StorageT> void LoadDatabaseByName(const std::string &name, StorageT &store);
template <class StorageT> void SaveDatabaseByName(const std::string &name, StorageT &store); template <class StorageT> void SaveDatabaseByName(const std::string &name, StorageT &store);
template <class RecordT> void AddRecordByType(uint32_t recordId, con st RecordT &rec); template <class RecordT> void AddRecordByType(uint32_t recordId, con st RecordT &rec);
 End of changes. 11 change blocks. 
16 lines changed or deleted 15 lines changed or added


 m_desktoptmpl.h   m_desktoptmpl.h 
/// ///
/// \file m_desktoptmpl.h /// \file m_desktoptmpl.h
/// Ease of use templates for the Desktop mode class /// Ease of use templates for the Desktop mode class
/// ///
/* /*
Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 m_ipmodem.h   m_ipmodem.h 
/// ///
/// \file m_ipmodem.h /// \file m_ipmodem.h
/// Mode class for GPRS modem mode (using endpoints on /// Mode class for GPRS modem mode (using endpoints on
/// modern devices) /// modern devices)
/// ///
/* /*
Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 33 skipping to change at line 33
#ifndef __BARRY_M_IPMODEM_H__ #ifndef __BARRY_M_IPMODEM_H__
#define __BARRY_M_IPMODEM_H__ #define __BARRY_M_IPMODEM_H__
#include "dll.h" #include "dll.h"
#include "modem.h" #include "modem.h"
#include "usbwrap.h" #include "usbwrap.h"
#include "data.h" #include "data.h"
#include "pppfilter.h" #include "pppfilter.h"
#include <pthread.h> #include <pthread.h>
#define SB_IPMODEM_SESSION_KEY_LENGTH 8
namespace Barry { namespace Barry {
// forward declarations // forward declarations
class Controller; class Controller;
namespace Mode { namespace Mode {
class BXEXPORT IpModem : public Modem class BXEXPORT IpModem : public Modem
{ {
public: public:
skipping to change at line 59 skipping to change at line 61
PppFilter m_filter; // used for 0x7e handling PppFilter m_filter; // used for 0x7e handling
// thread data // thread data
volatile bool m_continue_reading; volatile bool m_continue_reading;
pthread_t m_modem_read_thread; pthread_t m_modem_read_thread;
// external callbacks // external callbacks
DeviceDataCallback m_callback; DeviceDataCallback m_callback;
void *m_callback_context; void *m_callback_context;
unsigned char m_session_key[8]; // = { 0x00, 0, 0, 0, 0, 0, 0, 0 }; unsigned char m_session_key[SB_IPMODEM_SESSION_KEY_LENGTH]; // = { 0 x00, 0, 0, 0, 0, 0, 0, 0 };
private: private:
BXLOCAL bool SendPassword(const char *password = 0); BXLOCAL bool SendPassword(const char *password, uint32_t seed);
protected: protected:
static void *DataReadThread(void *userptr); static void *DataReadThread(void *userptr);
public: public:
IpModem(Controller &con, DeviceDataCallback callback, void *callback _context); IpModem(Controller &con, DeviceDataCallback callback, void *callback _context);
~IpModem(); ~IpModem();
////////////////////////////////// //////////////////////////////////
// general operations // general operations
 End of changes. 4 change blocks. 
3 lines changed or deleted 5 lines changed or added


 m_serial.h   m_serial.h 
/// ///
/// \file m_serial.h /// \file m_serial.h
/// Mode class for serial / GPRS modem mode /// Mode class for serial / GPRS modem mode
/// ///
/* /*
Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 modem.h   modem.h 
/// ///
/// \file modem.h /// \file modem.h
/// Modem API base class for the various serial/modem /// Modem API base class for the various serial/modem
/// modes available on the Blackberry. /// modes available on the Blackberry.
/// ///
/* /*
Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 parser.h   parser.h 
/// ///
/// \file parser.h /// \file parser.h
/// Virtual parser wrapper /// Virtual parser wrapper
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 31 skipping to change at line 31
#ifndef __BARRY_PARSER_H__ #ifndef __BARRY_PARSER_H__
#define __BARRY_PARSER_H__ #define __BARRY_PARSER_H__
#include "dll.h" #include "dll.h"
#include "data.h" #include "data.h"
#include "protocol.h" #include "protocol.h"
#include <stdint.h> // for uint32_t #include <stdint.h> // for uint32_t
// forward declarations // forward declarations
namespace Barry { class Data; } namespace Barry {
class Data;
class IConverter;
}
namespace Barry { namespace Barry {
// also acts as a null parser
// //
// Parser class // Parser class
// //
/// Base class for the parser hierarchy. If in debug mode, this /// Base class for the parser hierarchy.
/// class can be used as a null parser. Call Init() and the protocol
/// will be dumped to stdout and no parsing will be done.
/// ///
/// This class provides the interface that the Controller class uses /// This class provides the interface that the Controller class uses
/// to pass raw data it reads from the device. The Controller, along /// to pass raw data it reads from the device. The Controller, along
/// with the Packet class, calls each of the virtual functions below /// with the Packet class, calls each of the virtual functions below
/// in the same order. /// in the same order.
/// ///
/// This class is kept as a pure abstract class, in order to make sure
/// that the compiler will catch any API changes, for code derived
/// from it.
///
class BXEXPORT Parser class BXEXPORT Parser
{ {
public: public:
Parser() {} Parser() {}
virtual ~Parser() {} virtual ~Parser() {}
/// Reset and prepare for a new raw data packet /// Reset and prepare for a new raw data packet
virtual void Clear() = 0;
/// Stores the IDs
virtual void SetIds(uint8_t RecType, uint32_t UniqueId) = 0;
/// Called to parse the header portion of the raw data packet.
/// data contains the entire packet, and offset contains the
/// location at which to start parsing.
virtual void ParseHeader(const Data &data, size_t &offset) = 0;
/// Called to parse sub fields in the raw data packet.
/// The same data is passed as was passed in ParseHeader,
/// only the offset will be updated if it was advanced during
/// the header parsing.
virtual void ParseFields(const Data &data, size_t &offset,
const IConverter *ic) = 0;
/// Called at the very end of record parsing, and used to
/// store the final packet somewhere, either in memory, disk, etc.
virtual void Store() = 0;
};
//
// NullParser class
//
/// If in debug mode, this class can be used as a null parser.
/// Call Init() and the protocol will be dumped to stdout and
/// no parsing will be done.
///
/// Do NOT derive your own personal parser classes from this,
/// unless you are perfectly confident that you will catch
/// future API changes on the devel tree without the compiler's
/// help.
///
class BXEXPORT NullParser : public Parser
{
public:
NullParser() {}
virtual ~NullParser() {}
/// Reset and prepare for a new raw data packet
virtual void Clear() {} virtual void Clear() {}
/// Stores the IDs /// Stores the IDs
virtual void SetIds(uint8_t RecType, uint32_t UniqueId) {} virtual void SetIds(uint8_t RecType, uint32_t UniqueId) {}
/// Called to parse the header portion of the raw data packet. /// Called to parse the header portion of the raw data packet.
/// data contains the entire packet, and offset contains the /// data contains the entire packet, and offset contains the
/// location at which to start parsing. /// location at which to start parsing.
virtual void ParseHeader(const Data &data, size_t &offset) {} virtual void ParseHeader(const Data &data, size_t &offset) {}
/// Called to parse sub fields in the raw data packet. /// Called to parse sub fields in the raw data packet.
/// The same data is passed as was passed in ParseHeader, /// The same data is passed as was passed in ParseHeader,
/// only the offset will be updated if it was advanced during /// only the offset will be updated if it was advanced during
/// the header parsing. /// the header parsing.
virtual void ParseFields(const Data &data, size_t &offset) {} virtual void ParseFields(const Data &data, size_t &offset,
const IConverter *ic) {}
/// Called at the very end of record parsing, and used to /// Called at the very end of record parsing, and used to
/// store the final packet somewhere, either in memory, disk, etc. /// store the final packet somewhere, either in memory, disk, etc.
virtual void Store() {} virtual void Store() {}
}; };
// //
// RecordParser template class // RecordParser template class
// //
/// Template class for easy creation of specific parser objects. This temp late /// Template class for easy creation of specific parser objects. This temp late
skipping to change at line 149 skipping to change at line 195
virtual void SetIds(uint8_t RecType, uint32_t UniqueId) virtual void SetIds(uint8_t RecType, uint32_t UniqueId)
{ {
m_rec.SetIds(RecType, UniqueId); m_rec.SetIds(RecType, UniqueId);
} }
virtual void ParseHeader(const Data &data, size_t &offset) virtual void ParseHeader(const Data &data, size_t &offset)
{ {
m_rec.ParseHeader(data, offset); m_rec.ParseHeader(data, offset);
} }
virtual void ParseFields(const Data &data, size_t &offset) virtual void ParseFields(const Data &data, size_t &offset,
const IConverter *ic)
{ {
m_rec.ParseFields(data, offset); m_rec.ParseFields(data, offset, ic);
} }
virtual void Store() virtual void Store()
{ {
(*m_store)(m_rec); (*m_store)(m_rec);
} }
}; };
} // namespace Barry } // namespace Barry
 End of changes. 9 change blocks. 
9 lines changed or deleted 56 lines changed or added


 pppfilter.h   pppfilter.h 
/// ///
/// \file pppfilter.h /// \file pppfilter.h
/// Data filter class, to morph PPP data into something that /// Data filter class, to morph PPP data into something that
/// the Blackberry / Rogers / ISP can handle. /// the Blackberry / Rogers / ISP can handle.
/// This logic is based partly on XmBlackBerry's /// This logic is based partly on XmBlackBerry's
/// gprs_protocol_fix.c program. /// gprs_protocol_fix.c program.
/// ///
/* /*
Copyright (C) 2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2008-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 probe.h   probe.h 
/// ///
/// \file probe.h /// \file probe.h
/// USB Blackberry detection routines /// USB Blackberry detection routines
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 59 skipping to change at line 59
BXEXPORT std::ostream& operator<< (std::ostream &os, const ProbeResult &pr) ; BXEXPORT std::ostream& operator<< (std::ostream &os, const ProbeResult &pr) ;
class BXEXPORT Probe class BXEXPORT Probe
{ {
std::vector<ProbeResult> m_results; std::vector<ProbeResult> m_results;
std::vector<std::string> m_fail_msgs; std::vector<std::string> m_fail_msgs;
int m_fail_count; int m_fail_count;
bool m_epp_override;
Usb::EndpointPair m_epp;
BXLOCAL bool CheckSize(const Data &data, unsigned int required); BXLOCAL bool CheckSize(const Data &data, unsigned int required);
BXLOCAL bool ParsePIN(const Data &data, uint32_t &pin); BXLOCAL bool ParsePIN(const Data &data, uint32_t &pin);
BXLOCAL bool ParseDesc(const Data &data, std::string &desc); BXLOCAL bool ParseDesc(const Data &data, std::string &desc);
protected: protected:
void ProbeMatching(int vendor, int product, void ProbeMatching(int vendor, int product,
const char *busname, const char *devname); const char *busname, const char *devname);
void ProbeDevice(Usb::DeviceIDType devid); void ProbeDevice(Usb::DeviceIDType devid);
bool ProbePair(Usb::Device &dev, const Usb::EndpointPair &ep, bool ProbePair(Usb::Device &dev, const Usb::EndpointPair &ep,
uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequenc e); uint32_t &pin, std::string &desc, uint8_t &zeroSocketSequenc e);
bool ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep); bool ProbeModem(Usb::Device &dev, const Usb::EndpointPair &ep);
public: public:
Probe(const char *busname = 0, const char *devname = 0); Probe(const char *busname = 0, const char *devname = 0,
const Usb::EndpointPair *epp = 0);
int GetCount() const { return m_results.size(); } int GetCount() const { return m_results.size(); }
int GetFailCount() const { return m_fail_count; } int GetFailCount() const { return m_fail_count; }
const std::string& GetFailMsg(int index) const { return m_fail_msgs[ index]; } const std::string& GetFailMsg(int index) const { return m_fail_msgs[ index]; }
const ProbeResult& Get(int index) const { return m_results[index]; } const ProbeResult& Get(int index) const { return m_results[index]; }
int FindActive(uint32_t pin = 0) const; // returns -1 if pin not fou nd int FindActive(uint32_t pin = 0) const; // returns -1 if pin not fou nd
// or if no devices // or if no devices
}; };
 End of changes. 3 change blocks. 
2 lines changed or deleted 6 lines changed or added


 protocol.h   protocol.h 
/// ///
/// \file protocol.h /// \file protocol.h
/// USB Blackberry bulk protocol API constants /// USB Blackberry bulk protocol API constants
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_PROTOCOL_H__ #ifndef __BARRY_PROTOCOL_H__
#define __BARRY_PROTOCOL_H__ #define __BARRY_PROTOCOL_H__
// packet commands (Packet.command: has response codes too) // packet commands (Packet.command: has response codes too)
#define SB_COMMAND_ECHO 0x01
#define SB_COMMAND_ECHO_REPLY 0x02
#define SB_COMMAND_RESET 0x03
#define SB_COMMAND_RESET_REPLY 0x04
#define SB_COMMAND_FETCH_ATTRIBUTE 0x05 #define SB_COMMAND_FETCH_ATTRIBUTE 0x05
#define SB_COMMAND_FETCHED_ATTRIBUTE 0x06 #define SB_COMMAND_FETCHED_ATTRIBUTE 0x06
#define SB_COMMAND_SELECT_MODE 0x07 #define SB_COMMAND_SELECT_MODE 0x07
#define SB_COMMAND_MODE_SELECTED 0x08 #define SB_COMMAND_MODE_SELECTED 0x08
#define SB_COMMAND_OPEN_SOCKET 0x0a #define SB_COMMAND_OPEN_SOCKET 0x0a
#define SB_COMMAND_CLOSE_SOCKET 0x0b #define SB_COMMAND_CLOSE_SOCKET 0x0b
#define SB_COMMAND_CLOSED_SOCKET 0x0c #define SB_COMMAND_CLOSED_SOCKET 0x0c
#define SB_COMMAND_PASSWORD_CHALLENGE 0x0e #define SB_COMMAND_PASSWORD_CHALLENGE 0x0e
#define SB_COMMAND_PASSWORD 0x0f #define SB_COMMAND_PASSWORD 0x0f
#define SB_COMMAND_OPENED_SOCKET 0x10 #define SB_COMMAND_OPENED_SOCKET 0x10
#define SB_COMMAND_PASSWORD_FAILED 0x11 #define SB_COMMAND_PASSWORD_FAILED 0x11
#define SB_COMMAND_SEQUENCE_HANDSHAKE 0x13 #define SB_COMMAND_SEQUENCE_HANDSHAKE 0x13
#define SB_COMMAND_DB_DATA 0x40 #define SB_COMMAND_DB_DATA 0x40
#define SB_COMMAND_DB_FRAGMENTED 0x60 #define SB_COMMAND_DB_FRAGMENTED 0x60
#define SB_COMMAND_DB_DONE 0x41 #define SB_COMMAND_DB_DONE 0x41
// JavaLoader commands
#define SB_COMMAND_JL_HELLO 0x64 // This could be a general A
CK in both directions
#define SB_COMMAND_JL_HELLO_ACK 0x65 // From device after
host HELLO
#define SB_COMMAND_JL_GOODBYE 0x8d
#define SB_COMMAND_JL_SET_UNKNOWN1 0x70 // Initial sequence, 0
#define SB_COMMAND_JL_SET_COD_FILENAME 0x80
#define SB_COMMAND_JL_SET_COD_SIZE 0x67 // Always big endian
#define SB_COMMAND_JL_SEND_DATA 0x68
#define SB_COMMAND_JL_SET_TIME 0x7c
#define SB_COMMAND_JL_GET_SCREENSHOT 0x87
#define SB_COMMAND_JL_DEVICE_INFO 0x71
#define SB_COMMAND_JL_OS_METRICS 0x78
#define SB_COMMAND_JL_BOOTROM_METRICS 0x79
#define SB_COMMAND_JL_GET_DIRECTORY 0x6d
#define SB_COMMAND_JL_GET_DATA_ENTRY 0x6e // Used for both DIR and SCR
EENSHOT
#define SB_COMMAND_JL_GET_SUBDIR 0x7f
#define SB_COMMAND_JL_GET_SUBDIR_ENTRY 0x7d
#define SB_COMMAND_JL_ERASE 0x69
#define SB_COMMAND_JL_FORCE_ERASE 0x7b
#define SB_COMMAND_JL_UNKNOWN3 0x63
#define SB_COMMAND_JL_GET_LOG 0x73
#define SB_COMMAND_JL_GET_LOG_ENTRY 0x74
#define SB_COMMAND_JL_CLEAR_LOG 0x88
#define SB_COMMAND_JL_SAVE_MODULE 0x7e
#define SB_COMMAND_JL_WIPE_APPS 0x6a
#define SB_COMMAND_JL_WIPE_FS 0x6b
#define SB_COMMAND_JL_LOG_STRACES 0x8e
#define SB_COMMAND_JL_RESET_FACTORY 0x91
// JavaLoader response
#define SB_COMMAND_JL_ACK 0x64
#define SB_COMMAND_JL_READY 0x01
#define SB_COMMAND_JL_RESET_REQUIRED 0x78 // Occurs after GOODBYE when
handheld reset is required
#define SB_COMMAND_JL_COD_IN_USE 0x6c // Perhaps "BUSY" is also a
good name?
#define SB_COMMAND_JL_COD_NOT_FOUND 0x69
#define SB_COMMAND_JL_NOT_SUPPORTED 0x71 // Occurs when device does n
ot support a command
// JavaLoader data
#define SB_DATA_JL_SUCCESS 0x64 // Device has accepted the d
ata packet
#define SB_DATA_JL_INVALID 0x68 // Device returns this code
if the application isn't valid.
// mode constants // mode constants
#define SB_MODE_REQUEST_SOCKET 0x00ff #define SB_MODE_REQUEST_SOCKET 0x00ff
// object and attribute ID codes (for ZeroPacket::GetAttribute()) // object and attribute ID codes (for ZeroPacket::GetAttribute())
// meanings for most of these are unknown // meanings for most of these are unknown
#define SB_OBJECT_INITIAL_UNKNOWN 0x14 #define SB_OBJECT_INITIAL_UNKNOWN 0x14
#define SB_ATTR_INITIAL_UNKNOWN 0x01 #define SB_ATTR_INITIAL_UNKNOWN 0x01
#define SB_OBJECT_PROFILE 0x08 #define SB_OBJECT_PROFILE 0x08
#define SB_ATTR_PROFILE_DESC 0x02 #define SB_ATTR_PROFILE_DESC 0x02
#define SB_ATTR_PROFILE_PIN 0x04 #define SB_ATTR_PROFILE_PIN 0x04
 End of changes. 3 change blocks. 
1 lines changed or deleted 54 lines changed or added


 r_calendar.h   r_calendar.h 
/// ///
/// \file r_calendar.h /// \file r_calendar.h
/// Blackberry database record parser class for calndar records. /// Blackberry database record parser class for calndar records.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_RECORD_CALENDAR_H__ #ifndef __BARRY_RECORD_CALENDAR_H__
#define __BARRY_RECORD_CALENDAR_H__ #define __BARRY_RECORD_CALENDAR_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include "r_recur_base.h"
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdint.h> #include <stdint.h>
namespace Barry { namespace Barry {
// forward declarations
class IConverter;
// //
// NOTE: All classes here must be container-safe! Perhaps add sorting // NOTE: All classes here must be container-safe! Perhaps add sorting
// operators in the future. // operators in the future.
// //
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// @{ /// @{
class BXEXPORT Calendar class BXEXPORT Calendar : public RecurBase
{ {
public: public:
typedef std::vector<UnknownField> UnknownsType; typedef std::vector<UnknownField> UnknownsType;
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
// general data // general data
bool AllDayEvent; bool AllDayEvent;
std::string Subject; std::string Subject;
std::string Notes; std::string Notes;
std::string Location; std::string Location;
time_t NotificationTime; // 0 means notification is off time_t NotificationTime; // 0 means notification is off
time_t StartTime; time_t StartTime;
time_t EndTime; time_t EndTime;
EmailAddressList Organizer;
EmailAddressList AcceptedBy;
EmailAddressList Invited; // list of invited people (e
mail a
/// ///
/// Free Busy Flag /// Free Busy Flag
/// ///
/// This lists the available settings found in the device. /// This lists the available settings found in the device.
/// This list is based on information from MS Outlook 2007 /// This list is based on information from MS Outlook 2007
/// (Free ==0 and Busy == 2) /// (Free ==0 and Busy == 2)
/// This is FBTYPE in RFC2445 and is defined as /// This is FBTYPE in RFC2445 and is defined as
/// FREE, BUSY, BUSY-UNAVAILABLE and BUSY-TENTATIVE /// FREE, BUSY, BUSY-UNAVAILABLE and BUSY-TENTATIVE
/// ///
skipping to change at line 93 skipping to change at line 100
/// RFC2445 CLASS is PUBLIC, PRIVATE, CONFIDENTIAL /// RFC2445 CLASS is PUBLIC, PRIVATE, CONFIDENTIAL
/// ///
enum ClassFlagType { enum ClassFlagType {
Public = 0, Public = 0,
Confidential, Confidential,
Private Private
}; };
ClassFlagType ClassFlag; ClassFlagType ClassFlag;
///
/// Recurring data
///
/// Note: interval can be used on all of these recurring types to
/// make it happen "every other time" or more, etc.
///
enum RecurringCodeType {
Day = 1, //< eg. every day
//< set: nothing
MonthByDate = 3, //< eg. every month on the 12th
//< set: DayOfMonth
MonthByDay = 4, //< eg. every month on 3rd Wed
//< set: DayOfWeek and WeekOfMonth
YearByDate = 5, //< eg. every year on March 5
//< set: DayOfMonth and MonthOfYear
YearByDay = 6, //< eg. every year on 3rd Wed of Jan
//< set: DayOfWeek, WeekOfMonth, and
//< MonthOfYear
Week = 12 //< eg. every week on Mon and Fri
//< set: WeekDays
};
bool Recurring;
RecurringCodeType RecurringType;
unsigned short Interval; // must be >= 1
time_t RecurringEndTime; // only pertains if Recurring is tru
e
// sets the date and time when
// recurrence of this appointment
// should no longer occur
// If a perpetual appointment, this
// is 0xFFFFFFFF in the low level da
ta
// Instead, set the following flag.
bool Perpetual; // if true, this will always recur
unsigned short TimeZoneCode; // the time zone originally used unsigned short TimeZoneCode; // the time zone originally used
// for the recurrence data... // for the recurrence data...
// seems to have little use, but // seems to have little use, but
// set to your current time zone // set to your current time zone
// as a good default // as a good default
bool TimeZoneValid; // true if the record contained a bool TimeZoneValid; // true if the record contained a
// time zone code // time zone code
unsigned short // recurring details, depending on t
ype
DayOfWeek, // 0-6
WeekOfMonth, // 1-5
DayOfMonth, // 1-31
MonthOfYear; // 1-12
unsigned char WeekDays; // bitmask, bit 0 = sunday
// FIXME - put these somewhere usable by both C and C++
#define CAL_WD_SUN 0x01
#define CAL_WD_MON 0x02
#define CAL_WD_TUE 0x04
#define CAL_WD_WED 0x08
#define CAL_WD_THU 0x10
#define CAL_WD_FRI 0x20
#define CAL_WD_SAT 0x40
// unknown // unknown
UnknownsType Unknowns; UnknownsType Unknowns;
protected:
static FreeBusyFlagType FreeBusyFlagProto2Rec(uint8_t f);
static uint8_t FreeBusyFlagRec2Proto(FreeBusyFlagType f);
static ClassFlagType ClassFlagProto2Rec(uint8_t f);
static uint8_t ClassFlagRec2Proto(ClassFlagType f);
public: public:
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
void ParseRecurrenceData(const void *data);
void BuildRecurrenceData(void *data) const;
public: public:
Calendar(); Calendar();
~Calendar(); ~Calendar();
// Parser / Builder API (see parser.h / builder.h) // Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const; void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
// sorting // sorting
bool operator<(const Calendar &other) const { return StartTime < oth er.StartTime; } bool operator<(const Calendar &other) const { return StartTime < oth er.StartTime; }
// database name // database name
static const char * GetDBName() { return "Calendar"; } static const char * GetDBName() { return "Calendar"; }
 End of changes. 11 change blocks. 
59 lines changed or deleted 20 lines changed or added


 r_contact.h   r_contact.h 
/// ///
/// \file r_contact.h /// \file r_contact.h
/// Blackberry database record parser class for contact records. /// Blackberry database record parser class for contact records.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 35 skipping to change at line 35
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdint.h> #include <stdint.h>
namespace Barry { namespace Barry {
// forward declarations
class IConverter;
// //
// NOTE: All classes here must be container-safe! Perhaps add sorting // NOTE: All classes here must be container-safe! Perhaps add sorting
// operators in the future. // operators in the future.
// //
struct BXEXPORT ContactGroupLink struct BXEXPORT ContactGroupLink
{ {
uint32_t Link; uint32_t Link;
uint16_t Unknown; uint16_t Unknown;
ContactGroupLink() : Link(0), Unknown(0) {} ContactGroupLink() : Link(0), Unknown(0) {}
ContactGroupLink(uint32_t link, uint16_t unknown) ContactGroupLink(uint32_t link, uint16_t unknown)
: Link(link), Unknown(unknown) : Link(link), Unknown(unknown)
{} {}
}; };
typedef std::vector<std::string> CategoryList;
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// @{ /// @{
//
// Contact record class
//
/// Represents a single record in the Address Book Blackberry database.
///
class BXEXPORT Contact class BXEXPORT Contact
{ {
public: public:
typedef Barry::CategoryList CategoryList; typedef Barry::CategoryList CategoryList;
typedef ContactGroupLink GroupLink; typedef ContactGroupLink GroupLink;
typedef std::vector<GroupLink> GroupLinksType; typedef std::vector<GroupLink> GroupLinksType;
typedef std::vector<UnknownField> UnknownsType; typedef std::vector<UnknownField> UnknownsType;
typedef std::string EmailType; typedef std::string EmailType;
typedef std::vector<EmailType> EmailList; typedef std::vector<EmailType> EmailList;
//
// Record fields
//
// contact specific data // contact specific data
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
EmailList EmailAddresses; EmailList EmailAddresses;
/// This field, Phone, is deprecated. It is possible
/// to write to this field to the Blackberry,
/// but modern devices won't let you add it
/// through their GUIs. This field only seems
/// to exist on the 7750. While other devices
/// accept the field and display it, it is
/// not accessible by default.
std::string Phone;
std::string std::string
Phone,
Fax, Fax,
WorkPhone, WorkPhone,
HomePhone, HomePhone,
MobilePhone, MobilePhone,
Pager, Pager,
PIN, PIN,
Radio, Radio,
WorkPhone2, WorkPhone2,
HomePhone2, HomePhone2,
OtherPhone, OtherPhone,
skipping to change at line 115 skipping to change at line 134
// two categories, not only by this library, but by the // two categories, not only by this library, but by the
// device itself. // device itself.
CategoryList Categories; CategoryList Categories;
GroupLinksType GroupLinks; GroupLinksType GroupLinks;
UnknownsType Unknowns; UnknownsType Unknowns;
private: private:
bool m_FirstNameSeen; bool m_FirstNameSeen;
//protected:
public: public:
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
public: public:
Contact(); Contact();
~Contact(); ~Contact();
uint32_t GetID() const { return RecordId; } uint32_t GetID() const { return RecordId; }
std::string GetFullName() const; std::string GetFullName() const;
const std::string& GetEmail(unsigned int index = 0) const; const std::string& GetEmail(unsigned int index = 0) const;
// Parser / Builder API (see parser.h / builder.h) // Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const; void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
void Clear(); // erase everything void Clear(); // erase everything
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
// sorting - put group links at the end // sorting - put group links at the end
bool operator<(const Contact &other) const { bool operator<(const Contact &other) const {
return GroupLinks.size() == 0 && other.GroupLinks.size() > 0 ; return GroupLinks.size() == 0 && other.GroupLinks.size() > 0 ;
// // testing - put group links at the top // // testing - put group links at the top
// return GroupLinks.size() > 0 && other.GroupLinks.size() == 0 ; // return GroupLinks.size() > 0 && other.GroupLinks.size() == 0 ;
} }
// database name // database name
static const char * GetDBName() { return "Address Book"; } static const char * GetDBName() { return "Address Book"; }
static uint8_t GetDefaultRecType() { return 0; } static uint8_t GetDefaultRecType() { return 0; }
// helpers // helpers
static void SplitName(const std::string &full, std::string &first, s td::string &last); static void SplitName(const std::string &full, std::string &first, s td::string &last);
static void CategoryStr2List(const std::string &str, Barry::Category
List &list);
static void CategoryList2Str(const Barry::CategoryList &list, std::s
tring &str);
}; };
BXEXPORT inline std::ostream& operator<< (std::ostream &os, const Contact & contact) { BXEXPORT inline std::ostream& operator<< (std::ostream &os, const Contact & contact) {
contact.Dump(os); contact.Dump(os);
return os; return os;
} }
/// @} /// @}
} // namespace Barry } // namespace Barry
 End of changes. 12 change blocks. 
12 lines changed or deleted 26 lines changed or added


 r_folder.h   r_folder.h 
/// ///
/// \file r_folder.h /// \file r_folder.h
/// Record parsing class for the Folder database. /// Record parsing class for the Folder database.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
Copyright (C) 2007, Brian Edginton Copyright (C) 2007, Brian Edginton
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 34 skipping to change at line 34
#define __BARRY_RECORD_FOLDER_H__ #define __BARRY_RECORD_FOLDER_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
namespace Barry { namespace Barry {
// forward declarations
class IConverter;
class BXEXPORT Folder class BXEXPORT Folder
{ {
public: public:
typedef std::vector<UnknownField> UnknownsType ; typedef std::vector<UnknownField> UnknownsType ;
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
std::string FolderName; std::string Name;
uint16_t FolderNumber; // Not unique, used for ordering of uint16_t Number; // Not unique, used for ordering of subfolde
subfolders - NOT level rs - NOT level
uint16_t FolderLevel; // From parent uint16_t Level; // From parent
enum FolderTypeEnum { enum FolderType {
FolderSubtree = 0, FolderSubtree = 0,
FolderDeleted, FolderDeleted,
FolderInbox, FolderInbox,
FolderOutbox, FolderOutbox,
FolderSent, FolderSent,
FolderOther, FolderOther,
FolderDraft = 0x0a FolderDraft = 0x0a
}; };
FolderTypeEnum FolderType; FolderType Type;
enum FolderStatusType { enum FolderStatusType {
FolderOrphan = 0x50, FolderOrphan = 0x50,
FolderUnfiled, FolderUnfiled,
FolderFiled FolderFiled
}; };
UnknownsType Unknowns; UnknownsType Unknowns;
protected:
static FolderType TypeProto2Rec(uint8_t t);
static uint8_t TypeRec2Proto(FolderType t);
public: public:
Folder(); Folder();
~Folder(); ~Folder();
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
bool operator<(const Folder &other) const { return FolderName < othe r.FolderName; } bool operator<(const Folder &other) const { return Name < other.Name ; }
// database name // database name
static const char * GetDBName() { return "Folders"; } static const char * GetDBName() { return "Folders"; }
static uint8_t GetDefaultRecType() { return 0; } static uint8_t GetDefaultRecType() { return 0; }
}; };
BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Folder &ms g) { BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Folder &ms g) {
msg.Dump(os); msg.Dump(os);
return os; return os;
 End of changes. 9 change blocks. 
10 lines changed or deleted 17 lines changed or added


 r_memo.h   r_memo.h 
/// ///
/// \file r_memo.h /// \file r_memo.h
/// Record parsing class for the memo database. /// Record parsing class for the memo database.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
Copyright (C) 2007, Brian Edginton Copyright (C) 2007, Brian Edginton
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 34 skipping to change at line 34
#define __BARRY_RECORD_MEMO_H__ #define __BARRY_RECORD_MEMO_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
namespace Barry { namespace Barry {
// forward declarations
class IConverter;
class BXEXPORT Memo class BXEXPORT Memo
{ {
public: public:
typedef std::vector<UnknownField> UnknownsType; typedef std::vector<UnknownField> UnknownsType;
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
uint8_t MemoType;
std::string Title; std::string Title;
std::string Body; std::string Body;
std::string Category; CategoryList Categories;
UnknownsType Unknowns; UnknownsType Unknowns;
public: public:
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
public: public:
Memo(); Memo();
~Memo(); ~Memo();
// Parser / Builder API (see parser.h / builder.h) // Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
bool operator<(const Memo &other) const { return Title < other.Title ; } bool operator<(const Memo &other) const { return Title < other.Title ; }
// database name // database name
static const char * GetDBName() { return "Memos"; } static const char * GetDBName() { return "Memos"; }
static uint8_t GetDefaultRecType() { return 0; } // or 0? static uint8_t GetDefaultRecType() { return 0; } // or 0?
}; };
 End of changes. 7 change blocks. 
5 lines changed or deleted 8 lines changed or added


 r_message.h   r_message.h 
/// ///
/// \file r_message.h /// \file r_message.h
/// Blackberry database record parser class for email records. /// Blackberry database record parser class for email records.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_RECORD_MESSAGE_H__ #ifndef __BARRY_RECORD_MESSAGE_H__
#define __BARRY_RECORD_MESSAGE_H__ #define __BARRY_RECORD_MESSAGE_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "r_message_base.h"
#include <iosfwd>
#include <string>
#include <vector>
#include <map>
#include <stdint.h>
namespace Barry { namespace Barry {
// //
// NOTE: All classes here must be container-safe! Perhaps add sorting // NOTE: All classes here must be container-safe! Perhaps add sorting
// operators in the future. // operators in the future.
// //
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// @{ /// @{
class BXEXPORT Message class BXEXPORT Message : public MessageBase
{ {
public: public:
uint8_t RecType;
uint32_t RecordId;
EmailAddress From;
EmailAddress To;
EmailAddress Cc;
EmailAddress Bcc;
EmailAddress Sender;
EmailAddress ReplyTo;
std::string Subject;
std::string Body;
std::string Attachment;
uint32_t MessageRecordId;
uint32_t MessageReplyTo;
time_t MessageDateSent;
time_t MessageDateReceived;
// Message Flags
bool MessageTruncated;
bool MessageRead;
bool MessageReply;
bool MessageSaved;
bool MessageSavedDeleted;
enum MessagePriorityType {
LowPriority = 0,
NormalPriority,
HighPriority,
UnknownPriority
};
MessagePriorityType MessagePriority;
enum MessageSensitivityType {
NormalSensitivity = 0,
Personal,
Private,
Confidential,
UnknownSensitivity
};
MessageSensitivityType MessageSensitivity;
std::vector<UnknownField> Unknowns;
protected:
std::string SimpleEmailAddress() const;
public:
const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end);
public:
Message();
~Message();
// Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const;
uint32_t GetUniqueId() const; // empty API, not required by protoc
ol
void SetIds(uint8_t Type, uint32_t Id){ RecType = Type; RecordId = I
d; }
void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset);
void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const;
void Clear();
void Dump(std::ostream &os) const;
// sorting
bool operator<(const Message &other) const { return Subject < other.
Subject; }
// database name // database name
static const char * GetDBName() { return "Messages"; } static const char * GetDBName() { return "Messages"; }
static uint8_t GetDefaultRecType() { return 0; } static uint8_t GetDefaultRecType() { return 0; }
}; };
BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Message &m sg) { BXEXPORT inline std::ostream& operator<<(std::ostream &os, const Message &m sg) {
msg.Dump(os); msg.Dump(os);
return os; return os;
} }
 End of changes. 4 change blocks. 
81 lines changed or deleted 3 lines changed or added


 r_pin_message.h   r_pin_message.h 
/// ///
/// \file r_pin_message.h /// \file r_pin_message.h
/// Blackberry database record parser class for pin message reco rds. /// Blackberry database record parser class for pin message reco rds.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
Copyright (C) 2007, Brian Edginton (edge@edginton.net) Copyright (C) 2007, Brian Edginton (edge@edginton.net)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_RECORD_PIN_MESSAGE_H__ #ifndef __BARRY_RECORD_PIN_MESSAGE_H__
#define __BARRY_RECORD_PIN_MESSAGE_H__ #define __BARRY_RECORD_PIN_MESSAGE_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "r_message_base.h"
#include <iosfwd>
#include <string>
#include <vector>
#include <map>
#include <stdint.h>
namespace Barry { namespace Barry {
// //
// NOTE: All classes here must be container-safe! Perhaps add sorting // NOTE: All classes here must be container-safe! Perhaps add sorting
// operators in the future. // operators in the future.
// //
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// @{ /// @{
class BXEXPORT PINMessage class BXEXPORT PINMessage : public MessageBase
{ {
public: public:
uint8_t RecType;
uint32_t RecordId;
EmailAddress From;
EmailAddress To;
EmailAddress Cc;
EmailAddress Bcc;
std::string Subject;
std::string Body;
uint32_t MessageRecordId; // this happens to be the same as
// RecordId in my (CDF) testing,
// but interestingly, it is stored
// as a field *inside* the record,
// and not as part of the header...
// in effect, this record ID occurs
// twice in the protocol
uint32_t MessageReplyTo;
time_t MessageDateSent;
time_t MessageDateReceived;
// Message Flags
bool MessageTruncated;
bool MessageRead;
bool MessageReply;
bool MessageSaved;
bool MessageSavedDeleted;
enum MessagePriorityType {
LowPriority = 0,
NormalPriority,
HighPriority,
UnknownPriority
};
MessagePriorityType MessagePriority;
enum MessageSensitivityType {
NormalSensitivity = 0,
Personal,
Private,
Confidential,
UnknownSensitivity
};
MessageSensitivityType MessageSensitivity;
std::vector<UnknownField> Unknowns;
public:
const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end);
public:
PINMessage();
~PINMessage();
// Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId =
Id; }
void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset);
void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const;
void Clear();
void Dump(std::ostream &os) const;
// sorting
bool operator<(const PINMessage &other) const { return Subject < oth
er.Subject; }
// database name // database name
static const char * GetDBName() { return "PIN Messages"; } static const char * GetDBName() { return "PIN Messages"; }
static uint8_t GetDefaultRecType() { return 0; } static uint8_t GetDefaultRecType() { return 0; }
}; };
BXEXPORT inline std::ostream& operator<<(std::ostream &os, const PINMessage &msg) { BXEXPORT inline std::ostream& operator<<(std::ostream &os, const PINMessage &msg) {
msg.Dump(os); msg.Dump(os);
return os; return os;
} }
 End of changes. 4 change blocks. 
80 lines changed or deleted 3 lines changed or added


 r_saved_message.h   r_saved_message.h 
/// ///
/// \file r_save_message.h /// \file r_save_message.h
/// Blackberry database record parser class for saved email /// Blackberry database record parser class for saved email
/// message records. /// message records.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
Copyright (C) 2007, Brian Edginton (edge@edginton.net) Copyright (C) 2007, Brian Edginton (edge@edginton.net)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_RECORD_SAVED_MESSAGE_H__ #ifndef __BARRY_RECORD_SAVED_MESSAGE_H__
#define __BARRY_RECORD_SAVED_MESSAGE_H__ #define __BARRY_RECORD_SAVED_MESSAGE_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "r_message_base.h"
#include <iosfwd>
#include <string>
#include <vector>
#include <map>
#include <stdint.h>
namespace Barry { namespace Barry {
// //
// NOTE: All classes here must be container-safe! Perhaps add sorting // NOTE: All classes here must be container-safe! Perhaps add sorting
// operators in the future. // operators in the future.
// //
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// @{ /// @{
class BXEXPORT SavedMessage class BXEXPORT SavedMessage : public MessageBase
{ {
public: public:
uint8_t RecType;
uint32_t RecordId;
EmailAddress From;
EmailAddress To;
EmailAddress Cc;
EmailAddress Bcc;
EmailAddress Sender;
EmailAddress ReplyTo;
std::string Subject;
std::string Body;
std::string Attachment;
uint32_t MessageRecordId;
uint32_t MessageReplyTo;
time_t MessageDateSent;
time_t MessageDateReceived;
// Message Flags
bool MessageTruncated;
bool MessageRead;
bool MessageReply;
bool MessageSaved;
bool MessageSavedDeleted;
enum MessagePriorityType {
LowPriority = 0,
NormalPriority,
HighPriority,
UnknownPriority
};
MessagePriorityType MessagePriority;
enum MessageSensitivityType {
NormalSensitivity = 0,
Personal,
Private,
Confidential,
UnknownSensitivity
};
MessageSensitivityType MessageSensitivity;
std::vector<UnknownField> Unknowns;
public:
const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end);
public:
SavedMessage();
~SavedMessage();
// Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId =
Id; }
void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset);
void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const;
void Clear();
void Dump(std::ostream &os) const;
// sorting
bool operator<(const SavedMessage &other) const { return Subject < o
ther.Subject; }
// database name // database name
static const char * GetDBName() { return "Saved Email Messages"; } static const char * GetDBName() { return "Saved Email Messages"; }
static uint8_t GetDefaultRecType() { return 3; } static uint8_t GetDefaultRecType() { return 3; }
}; };
BXEXPORT inline std::ostream& operator<<(std::ostream &os, const SavedMessa ge &msg) { BXEXPORT inline std::ostream& operator<<(std::ostream &os, const SavedMessa ge &msg) {
msg.Dump(os); msg.Dump(os);
return os; return os;
} }
 End of changes. 4 change blocks. 
75 lines changed or deleted 3 lines changed or added


 r_servicebook.h   r_servicebook.h 
/// ///
/// \file r_servicebook.h /// \file r_servicebook.h
/// Blackberry database record parser class for the /// Blackberry database record parser class for the
/// Service Book record. /// Service Book record.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 36 skipping to change at line 36
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include <iosfwd> #include <iosfwd>
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
#include <stdint.h> #include <stdint.h>
namespace Barry { namespace Barry {
// forward declarations
class IConverter;
// //
// NOTE: All classes here must be container-safe! Perhaps add sorting // NOTE: All classes here must be container-safe! Perhaps add sorting
// operators in the future. // operators in the future.
// //
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// @{ /// @{
// This is a packed field, which is a group of fields packed in // This is a packed field, which is a group of fields packed in
// variable length records inside one larger field of a normal record. // variable length records inside one larger field of a normal record.
skipping to change at line 57 skipping to change at line 60
{ {
public: public:
typedef std::vector<UnknownField> UnknownsType; typedef std::vector<UnknownField> UnknownsType;
uint8_t Format; uint8_t Format;
UnknownsType Unknowns; UnknownsType Unknowns;
public: public:
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
public: public:
ServiceBookConfig(); ServiceBookConfig();
~ServiceBookConfig(); ~ServiceBookConfig();
// Parser / Builder API (see parser.h / builder.h) // Parser / Builder API (see parser.h / builder.h)
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const; void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
}; };
BXEXPORT inline std::ostream& operator<<(std::ostream &os, const ServiceBoo kConfig &msg) { BXEXPORT inline std::ostream& operator<<(std::ostream &os, const ServiceBoo kConfig &msg) {
msg.Dump(os); msg.Dump(os);
return os; return os;
} }
class ServiceBookData;
class BXEXPORT ServiceBook class BXEXPORT ServiceBook
{ {
int NameType, DescType, UniqueIdType; ServiceBookData *m_data;
public: public:
typedef std::vector<UnknownField> UnknownsType; typedef std::vector<UnknownField> UnknownsType;
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
std::string Name; std::string Name;
std::string HiddenName; std::string HiddenName;
std::string Description; std::string Description;
std::string DSID; std::string DSID;
std::string BesDomain; std::string BesDomain;
std::string UniqueId; std::string UniqueId;
std::string ContentId; std::string ContentId;
ServiceBookConfig Config; ServiceBookConfig Config;
UnknownsType Unknowns; UnknownsType Unknowns;
public: public:
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
public: public:
ServiceBook(); ServiceBook();
~ServiceBook(); ~ServiceBook();
// Parser / Builder API (see parser.h / builder.h) // Parser / Builder API (see parser.h / builder.h)
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset) const; void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
// sorting // sorting
bool operator<(const ServiceBook &other) const { return RecordId < R ecordId; } bool operator<(const ServiceBook &other) const { return RecordId < R ecordId; }
// database name // database name
static const char * GetDBName() { return "Service Book"; } static const char * GetDBName() { return "Service Book"; }
 End of changes. 10 change blocks. 
8 lines changed or deleted 13 lines changed or added


 r_task.h   r_task.h 
/// ///
/// \file r_task.h /// \file r_task.h
/// Record parsing class for the task database. /// Record parsing class for the task database.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
Copyright (C) 2007, Brian Edginton Copyright (C) 2007, Brian Edginton
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_RECORD_TASK_H__ #ifndef __BARRY_RECORD_TASK_H__
#define __BARRY_RECORD_TASK_H__ #define __BARRY_RECORD_TASK_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include "r_recur_base.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
namespace Barry { namespace Barry {
class BXEXPORT Task // forward declarations
class IConverter;
class BXEXPORT Task : public RecurBase
{ {
public: public:
typedef std::vector<UnknownField> UnknownsType typedef std::vector<UnknownField> UnknownsType;
;
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
uint8_t TaskType;
std::string Summary; std::string Summary;
std::string Notes; std::string Notes;
std::string Categories; CategoryList Categories;
std::string UID; std::string UID;
time_t StartTime; time_t StartTime;
time_t DueTime; time_t DueTime;
time_t AlarmTime; time_t AlarmTime;
int TimeZoneCode; unsigned short TimeZoneCode;
bool TimeZoneValid; // true if the record contained a
// time zone code
enum AlarmFlagType enum AlarmFlagType
{ {
Date = 1, Date = 1,
Relative Relative
}; };
AlarmFlagType AlarmType; AlarmFlagType AlarmType;
unsigned short Interval;
enum RecurringCodeType {
Day = 1, //< eg. every day
//< set: nothing
MonthByDate = 3, //< eg. every month on the 12th
//< set: DayOfMonth
MonthByDay = 4, //< eg. every month on 3rd Wed
//< set: DayOfWeek and WeekOfMonth
YearByDate = 5, //< eg. every year on March 5
//< set: DayOfMonth and MonthOfYear
YearByDay = 6, //< eg. every year on 3rd Wed of Jan
//< set: DayOfWeek, WeekOfMonth, and
//< MonthOfYear
Week = 12 //< eg. every week on Mon and Fri
//< set: WeekDays
};
RecurringCodeType RecurringType;
time_t RecurringEndTime;
unsigned short // recurring details, depending on t
ype
DayOfWeek, // 0-6
WeekOfMonth, // 1-5
DayOfMonth, // 1-31
MonthOfYear; // 1-12
unsigned char WeekDays; // bitmask, bit 0 = sunday
int ClassType;
enum PriorityFlagType enum PriorityFlagType
{ {
High = 0, High = 0,
Normal, Normal,
Low Low
}; };
PriorityFlagType PriorityFlag; PriorityFlagType PriorityFlag;
enum StatusFlagType enum StatusFlagType
{ {
NotStarted = 0, NotStarted = 0,
InProgress, InProgress,
Completed, Completed,
Waiting, Waiting,
Deferred Deferred
}; };
StatusFlagType StatusFlag; StatusFlagType StatusFlag;
bool Recurring;
bool Perpetual;
bool DueDateFlag; // true if due date is set bool DueDateFlag; // true if due date is set
// unknown
UnknownsType Unknowns; UnknownsType Unknowns;
protected:
static AlarmFlagType AlarmProto2Rec(uint8_t a);
static uint8_t AlarmRec2Proto(AlarmFlagType a);
static PriorityFlagType PriorityProto2Rec(uint8_t p);
static uint8_t PriorityRec2Proto(PriorityFlagType p);
static StatusFlagType StatusProto2Rec(uint8_t s);
static uint8_t StatusRec2Proto(StatusFlagType s);
public: public:
Task(); Task();
~Task(); ~Task();
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
void ParseRecurrenceData(const void *data);
void BuildRecurrenceData(void *data);
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void BuildFields(Data &data, size_t &offset, const IConverter *ic = 0) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
bool operator<(const Task &other) const { return Summary < other.Sum mary; } bool operator<(const Task &other) const { return Summary < other.Sum mary; }
// database name // database name
static const char * GetDBName() { return "Tasks"; } static const char * GetDBName() { return "Tasks"; }
static uint8_t GetDefaultRecType() { return 2; } static uint8_t GetDefaultRecType() { return 2; }
 End of changes. 14 change blocks. 
40 lines changed or deleted 26 lines changed or added


 r_timezone.h   r_timezone.h 
/// ///
/// \file r_timezone.h /// \file r_timezone.h
/// Record parsing class for the timezone database. /// Record parsing class for the timezone database.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
Copyright (C) 2008, Brian Edginton Copyright (C) 2008, Brian Edginton
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 32 skipping to change at line 32
#ifndef __BARRY_RECORD_TIMEZONE_H__ #ifndef __BARRY_RECORD_TIMEZONE_H__
#define __BARRY_RECORD_TIMEZONE_H__ #define __BARRY_RECORD_TIMEZONE_H__
#include "dll.h" #include "dll.h"
#include "record.h" #include "record.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <stdint.h> #include <stdint.h>
namespace Barry namespace Barry {
{
// forward declarations
class IConverter;
class BXEXPORT Timezone class BXEXPORT Timezone
{ {
public: public:
typedef std::vector<UnknownField> UnknownsType ; typedef std::vector<UnknownField> UnknownsType ;
uint8_t RecType; uint8_t RecType;
uint32_t RecordId; uint32_t RecordId;
uint8_t TZType; uint8_t TZType;
skipping to change at line 63 skipping to change at line 65
std::string TimeZoneName; std::string TimeZoneName;
UnknownsType Unknowns; UnknownsType Unknowns;
public: public:
Timezone(); Timezone();
virtual ~Timezone(); virtual ~Timezone();
const unsigned char* ParseField(const unsigned char *begin, const unsigned char* ParseField(const unsigned char *begin,
const unsigned char *end); const unsigned char *end, const IConverter *ic = 0);
void ParseRecurrenceData(const void *data); void ParseRecurrenceData(const void *data);
void BuildRecurrenceData(void *data); void BuildRecurrenceData(void *data);
uint8_t GetRecType() const { return RecType; } uint8_t GetRecType() const { return RecType; }
uint32_t GetUniqueId() const { return RecordId; } uint32_t GetUniqueId() const { return RecordId; }
void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; } void SetIds(uint8_t Type, uint32_t Id) { RecType = Type; RecordId = Id; }
void ParseHeader(const Data &data, size_t &offset); void ParseHeader(const Data &data, size_t &offset);
void ParseFields(const Data &data, size_t &offset); void ParseFields(const Data &data, size_t &offset, const IConverter *ic = 0);
void BuildHeader(Data &data, size_t &offset) const; void BuildHeader(Data &data, size_t &offset) const;
void Clear(); void Clear();
void Dump(std::ostream &os) const; void Dump(std::ostream &os) const;
bool operator<(const Timezone &other) const { return TimeZoneName < other.TimeZoneName; } bool operator<(const Timezone &other) const { return TimeZoneName < other.TimeZoneName; }
// database name // database name
static const char * GetDBName() { return "Time Zones"; } static const char * GetDBName() { return "Time Zones"; }
static uint8_t GetDefaultRecType() { return 2; } static uint8_t GetDefaultRecType() { return 2; }
 End of changes. 4 change blocks. 
5 lines changed or deleted 7 lines changed or added


 record.h   record.h 
skipping to change at line 12 skipping to change at line 12
/// \file record.h /// \file record.h
/// Blackberry database record classes. Help translate data /// Blackberry database record classes. Help translate data
/// from data packets to useful structurs, and back. /// from data packets to useful structurs, and back.
/// This header provides the common types and classes /// This header provides the common types and classes
/// used by the general record parser classes in the /// used by the general record parser classes in the
/// r_*.h files. Only application-safe API stuff goes in /// r_*.h files. Only application-safe API stuff goes in
/// here. Internal library types go in record-internal.h /// here. Internal library types go in record-internal.h
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 195 skipping to change at line 195
struct BXEXPORT EmailAddress struct BXEXPORT EmailAddress
{ {
std::string Name; std::string Name;
std::string Email; std::string Email;
void clear() void clear()
{ {
Name.clear(); Name.clear();
Email.clear(); Email.clear();
} }
size_t size() const
{
return Name.size() + Email.size();
}
}; };
BXEXPORT std::ostream& operator<<(std::ostream &os, const EmailAddress &msg a); BXEXPORT std::ostream& operator<<(std::ostream &os, const EmailAddress &msg a);
typedef std::vector<EmailAddress> EmailAddressList;
BXEXPORT std::ostream& operator<<(std::ostream &os, const EmailAddressList
&elist);
struct BXEXPORT PostalAddress struct BXEXPORT PostalAddress
{ {
std::string std::string
Address1, Address1,
Address2, Address2,
Address3, Address3,
City, City,
Province, Province,
PostalCode, PostalCode,
Country; Country;
skipping to change at line 241 skipping to change at line 249
std::string ToYYYYMMDD() const; std::string ToYYYYMMDD() const;
std::string ToBBString() const; // converts to Blackberry string std::string ToBBString() const; // converts to Blackberry string
// format of DD/MM/YYYY // format of DD/MM/YYYY
bool FromTm(const struct tm *timep); bool FromTm(const struct tm *timep);
bool FromBBString(const std::string &str); bool FromBBString(const std::string &str);
bool FromYYYYMMDD(const std::string &str); bool FromYYYYMMDD(const std::string &str);
}; };
BXEXPORT std::ostream& operator<<(std::ostream &os, const Date &date); BXEXPORT std::ostream& operator<<(std::ostream &os, const Date &date);
class BXEXPORT CategoryList : public std::vector<std::string>
{
public:
/// Parses the given comma delimited category string into
/// this CategoryList object, appending each token to the vector.
/// Will clear vector beforehand.
void CategoryStr2List(const std::string &str);
/// Turns the current vectory into a comma delimited category
/// string suitable for use in Calendar, Task, and Memo
/// protocol values.
void CategoryList2Str(std::string &str) const;
using std::vector<std::string>::operator=;
};
/// \addtogroup RecordParserClasses /// \addtogroup RecordParserClasses
/// Parser and data storage classes. These classes take a /// Parser and data storage classes. These classes take a
/// Database Database record and convert them into C++ objects. /// Database Database record and convert them into C++ objects.
/// Each of these classes are safe to be used in standard /// Each of these classes are safe to be used in standard
/// containers, and are meant to be used in conjunction with the /// containers, and are meant to be used in conjunction with the
/// RecordParser<> template when calling Controller::LoadDatabas e(). /// RecordParser<> template when calling Controller::LoadDatabas e().
/// @{ /// @{
/// @} /// @}
} // namespace Barry } // namespace Barry
#ifndef __BARRY_LIBRARY_BUILD__
// Include all parser classes, to make it easy for the application to use. // Include all parser classes, to make it easy for the application to use.
#include "r_calendar.h" #include "r_calendar.h"
#include "r_calllog.h"
#include "r_contact.h" #include "r_contact.h"
#include "r_memo.h" #include "r_memo.h"
#include "r_message.h" #include "r_message.h"
#include "r_servicebook.h" #include "r_servicebook.h"
#include "r_task.h" #include "r_task.h"
#include "r_pin_message.h" #include "r_pin_message.h"
#include "r_saved_message.h" #include "r_saved_message.h"
#include "r_sms.h"
#include "r_folder.h" #include "r_folder.h"
#include "r_timezone.h" #include "r_timezone.h"
#endif
#endif #endif
 End of changes. 8 change blocks. 
1 lines changed or deleted 30 lines changed or added


 router.h   router.h 
/// ///
/// \file router.h /// \file router.h
/// Support classes for the pluggable socket routing system. /// Support classes for the pluggable socket routing system.
/// ///
/* /*
Copyright (C) 2005-2007, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 238 skipping to change at line 238
} }
const Data* operator->() const const Data* operator->() const
{ {
return m_data; return m_data;
} }
DataHandle& operator=(const DataHandle &other) DataHandle& operator=(const DataHandle &other)
{ {
if( &m_queue != &other.m_queue ) if( &m_queue != &other.m_queue )
throw std::logic_error("Trying to copy DataHandles o f different queus!"); throw std::logic_error("Trying to copy DataHandles o f different queues!");
// remove our current data // remove our current data
clear(); clear();
// accept the new // accept the new
m_data = other.m_data; m_data = other.m_data;
// we now own it // we now own it
other.m_data = 0; other.m_data = 0;
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 s11n-boost.h   s11n-boost.h 
/// ///
/// \file s11n-boost.h /// \file s11n-boost.h
/// Non-intrusive versions of serialization functions for the /// Non-intrusive versions of serialization functions for the
/// record classes. These template functions make it possible /// record classes. These template functions make it possible
/// to use the record classes with the Boost::Serialization /// to use the record classes with the Boost::Serialization
/// library. /// library.
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 63 skipping to change at line 63
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Contact::GroupLink &g, const unsigned i nt ver) void serialize(ArchiveT &ar, Barry::Contact::GroupLink &g, const unsigned i nt ver)
{ {
ar & make_nvp("Link", g.Link); ar & make_nvp("Link", g.Link);
ar & make_nvp("Unknown", g.Unknown); ar & make_nvp("Unknown", g.Unknown);
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::CategoryList &cl, const unsigned int ve
r)
{
std::vector<std::string> &sl = cl;
ar & make_nvp("CategoryList", sl);
}
template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Contact &c, const unsigned int ver) void serialize(ArchiveT &ar, Barry::Contact &c, const unsigned int ver)
{ {
ar & make_nvp("RecType", c.RecType); ar & make_nvp("RecType", c.RecType);
ar & make_nvp("RecordId", c.RecordId); ar & make_nvp("RecordId", c.RecordId);
ar & make_nvp("EmailAddresses", c.EmailAddresses); ar & make_nvp("EmailAddresses", c.EmailAddresses);
ar & make_nvp("Phone", c.Phone); ar & make_nvp("Phone", c.Phone);
ar & make_nvp("Fax", c.Fax); ar & make_nvp("Fax", c.Fax);
ar & make_nvp("WorkPhone", c.WorkPhone); ar & make_nvp("WorkPhone", c.WorkPhone);
ar & make_nvp("HomePhone", c.HomePhone); ar & make_nvp("HomePhone", c.HomePhone);
skipping to change at line 145 skipping to change at line 152
ar & make_nvp("MessageReplyTo", m.MessageReplyTo); ar & make_nvp("MessageReplyTo", m.MessageReplyTo);
ar & make_nvp("MessageDateSent", m.MessageDateSent); ar & make_nvp("MessageDateSent", m.MessageDateSent);
ar & make_nvp("MessageDateReceived", m.MessageDateReceived); ar & make_nvp("MessageDateReceived", m.MessageDateReceived);
ar & make_nvp("MessageTruncated", m.MessageTruncated); ar & make_nvp("MessageTruncated", m.MessageTruncated);
ar & make_nvp("MessageRead", m.MessageRead); ar & make_nvp("MessageRead", m.MessageRead);
ar & make_nvp("MessageReply", m.MessageReply); ar & make_nvp("MessageReply", m.MessageReply);
ar & make_nvp("MessageSaved", m.MessageSaved); ar & make_nvp("MessageSaved", m.MessageSaved);
ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted); ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted);
ar & make_nvp("MessagePriority", m.MessagePriority); ar & make_nvp("MessagePriority", m.Priority);
ar & make_nvp("MessageSensitivity", m.MessageSensitivity); ar & make_nvp("MessageSensitivity", m.Sensitivity);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp("Unknowns", m.Unknowns); ar & make_nvp("Unknowns", m.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Calendar &c, const unsigned int ver) void serialize(ArchiveT &ar, Barry::Calendar &c, const unsigned int ver)
{ {
ar & make_nvp("RecType", c.RecType); ar & make_nvp("RecType", c.RecType);
skipping to change at line 169 skipping to change at line 176
ar & make_nvp("AllDayEvent", c.AllDayEvent); ar & make_nvp("AllDayEvent", c.AllDayEvent);
ar & make_nvp("Subject", c.Subject); ar & make_nvp("Subject", c.Subject);
ar & make_nvp("Notes", c.Notes); ar & make_nvp("Notes", c.Notes);
ar & make_nvp("Location", c.Location); ar & make_nvp("Location", c.Location);
ar & make_nvp("NotificationTime", c.NotificationTime); ar & make_nvp("NotificationTime", c.NotificationTime);
ar & make_nvp("StartTime", c.StartTime); ar & make_nvp("StartTime", c.StartTime);
ar & make_nvp("EndTime", c.EndTime); ar & make_nvp("EndTime", c.EndTime);
ar & make_nvp("Organizer", c.Organizer);
ar & make_nvp("AcceptedBy", c.AcceptedBy);
ar & make_nvp("Invited", c.Invited);
ar & make_nvp("FreeBusyFlag", c.FreeBusyFlag); ar & make_nvp("FreeBusyFlag", c.FreeBusyFlag);
ar & make_nvp("ClassFlag", c.ClassFlag); ar & make_nvp("ClassFlag", c.ClassFlag);
ar & make_nvp("Recurring", c.Recurring); ar & make_nvp("Recurring", c.Recurring);
ar & make_nvp("RecurringType", c.RecurringType); ar & make_nvp("RecurringType", c.RecurringType);
ar & make_nvp("Interval", c.Interval); ar & make_nvp("Interval", c.Interval);
ar & make_nvp("RecurringEndTime", c.RecurringEndTime); ar & make_nvp("RecurringEndTime", c.RecurringEndTime);
ar & make_nvp("Perpetual", c.Perpetual); ar & make_nvp("Perpetual", c.Perpetual);
ar & make_nvp("TimeZoneCode", c.TimeZoneCode); ar & make_nvp("TimeZoneCode", c.TimeZoneCode);
ar & make_nvp("TimeZoneValid", c.TimeZoneValid); ar & make_nvp("TimeZoneValid", c.TimeZoneValid);
skipping to change at line 192 skipping to change at line 203
ar & make_nvp("DayOfMonth", c.DayOfMonth); ar & make_nvp("DayOfMonth", c.DayOfMonth);
ar & make_nvp("MonthOfYear", c.MonthOfYear); ar & make_nvp("MonthOfYear", c.MonthOfYear);
ar & make_nvp("WeekDays", c.WeekDays); ar & make_nvp("WeekDays", c.WeekDays);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp("Unknowns", c.Unknowns); ar & make_nvp("Unknowns", c.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::CallLog &c, const unsigned int ver)
{
ar & make_nvp("RecType", c.RecType);
ar & make_nvp("RecordId", c.RecordId);
ar & make_nvp("Duration", c.Duration);
ar & make_nvp("Timestamp", c.Timestamp);
ar & make_nvp("ContactName", c.ContactName);
ar & make_nvp("PhoneNumber", c.PhoneNumber);
ar & make_nvp("DirectionFlag", c.DirectionFlag);
ar & make_nvp("StatusFlag", c.StatusFlag);
ar & make_nvp("PhoneTypeFlag", c.PhoneTypeFlag);
ar & make_nvp("PhoneInfoFlag", c.PhoneInfoFlag);
if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp("Unknowns", c.Unknowns);
}
}
template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::ServiceBookConfig &c, const unsigned in t ver) void serialize(ArchiveT &ar, Barry::ServiceBookConfig &c, const unsigned in t ver)
{ {
ar & make_nvp("Format", c.Format); ar & make_nvp("Format", c.Format);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp("Unknowns", c.Unknowns); ar & make_nvp("Unknowns", c.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
skipping to change at line 227 skipping to change at line 259
ar & make_nvp("Unknowns", c.Unknowns); ar & make_nvp("Unknowns", c.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Memo &m, const unsigned int ver) void serialize(ArchiveT &ar, Barry::Memo &m, const unsigned int ver)
{ {
ar & make_nvp("RecType", m.RecType); ar & make_nvp("RecType", m.RecType);
ar & make_nvp("RecordId", m.RecordId); ar & make_nvp("RecordId", m.RecordId);
ar & make_nvp("MemoType", m.MemoType);
ar & make_nvp("Title", m.Title); ar & make_nvp("Title", m.Title);
ar & make_nvp("Body", m.Body); ar & make_nvp("Body", m.Body);
ar & make_nvp("Category", m.Category); ar & make_nvp("Categories", m.Categories);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp( "Unknowns", m.Unknowns); ar & make_nvp( "Unknowns", m.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Task &t, const unsigned int ver) void serialize(ArchiveT &ar, Barry::Task &t, const unsigned int ver)
{ {
ar & make_nvp("RecType", t.RecType); ar & make_nvp("RecType", t.RecType);
ar & make_nvp("RecordId", t.RecordId); ar & make_nvp("RecordId", t.RecordId);
ar & make_nvp("TaskType", t.TaskType);
ar & make_nvp("Summary", t.Summary); ar & make_nvp("Summary", t.Summary);
ar & make_nvp("Notes", t.Notes); ar & make_nvp("Notes", t.Notes);
ar & make_nvp("Categories", t.Categories); ar & make_nvp("Categories", t.Categories);
ar & make_nvp("UID", t.UID); ar & make_nvp("UID", t.UID);
ar & make_nvp("StartTime", t.StartTime); ar & make_nvp("StartTime", t.StartTime);
ar & make_nvp("DueTime", t.DueTime); ar & make_nvp("DueTime", t.DueTime);
ar & make_nvp("AlarmTime", t.AlarmTime); ar & make_nvp("AlarmTime", t.AlarmTime);
ar & make_nvp("TimeZoneCode", t.TimeZoneCode); ar & make_nvp("TimeZoneCode", t.TimeZoneCode);
ar & make_nvp("TimeZoneValid", t.TimeZoneValid);
ar & make_nvp("AlarmType", t.AlarmType); ar & make_nvp("AlarmType", t.AlarmType);
ar & make_nvp("Interval", t.Interval); ar & make_nvp("Interval", t.Interval);
ar & make_nvp("RecurringType", t.RecurringType); ar & make_nvp("RecurringType", t.RecurringType);
ar & make_nvp("RecurringEndTime", t.RecurringEndTime); ar & make_nvp("RecurringEndTime", t.RecurringEndTime);
ar & make_nvp("DayOfWeek", t.DayOfWeek); ar & make_nvp("DayOfWeek", t.DayOfWeek);
ar & make_nvp("WeekOfMonth", t.WeekOfMonth); ar & make_nvp("WeekOfMonth", t.WeekOfMonth);
ar & make_nvp("DayOfMonth", t.DayOfMonth); ar & make_nvp("DayOfMonth", t.DayOfMonth);
ar & make_nvp("MonthOfYear", t.MonthOfYear); ar & make_nvp("MonthOfYear", t.MonthOfYear);
ar & make_nvp("WeekDays", t.WeekDays); ar & make_nvp("WeekDays", t.WeekDays);
ar & make_nvp("ClassType", t.ClassType);
ar & make_nvp("PriorityFlag", t.PriorityFlag); ar & make_nvp("PriorityFlag", t.PriorityFlag);
ar & make_nvp("StatusFlag", t.StatusFlag); ar & make_nvp("StatusFlag", t.StatusFlag);
ar & make_nvp("Recurring", t.Recurring); ar & make_nvp("Recurring", t.Recurring);
ar & make_nvp("Perpetual", t.Perpetual); ar & make_nvp("Perpetual", t.Perpetual);
ar & make_nvp("DueDateFlag", t.DueDateFlag); ar & make_nvp("DueDateFlag", t.DueDateFlag);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp( "Unknowns", t.Unknowns); ar & make_nvp( "Unknowns", t.Unknowns);
} }
} }
skipping to change at line 300 skipping to change at line 330
ar & make_nvp("MessageReplyTo", p.MessageReplyTo); ar & make_nvp("MessageReplyTo", p.MessageReplyTo);
ar & make_nvp("MessageDateSent", p.MessageDateSent); ar & make_nvp("MessageDateSent", p.MessageDateSent);
ar & make_nvp("MessageDateReceived", p.MessageDateReceived); ar & make_nvp("MessageDateReceived", p.MessageDateReceived);
ar & make_nvp("MessageTruncated", p.MessageTruncated); ar & make_nvp("MessageTruncated", p.MessageTruncated);
ar & make_nvp("MessageRead", p.MessageRead); ar & make_nvp("MessageRead", p.MessageRead);
ar & make_nvp("MessageReply", p.MessageReply); ar & make_nvp("MessageReply", p.MessageReply);
ar & make_nvp("MessageSaved", p.MessageSaved); ar & make_nvp("MessageSaved", p.MessageSaved);
ar & make_nvp("MessageSavedDeleted", p.MessageSavedDeleted); ar & make_nvp("MessageSavedDeleted", p.MessageSavedDeleted);
ar & make_nvp("MessagePriority", p.MessagePriority); ar & make_nvp("MessagePriority", p.Priority);
ar & make_nvp("MessageSensitivity", p.MessageSensitivity); ar & make_nvp("MessageSensitivity", p.Sensitivity);
if(ver < BARRY_POD_MAP_VERSION) { if(ver < BARRY_POD_MAP_VERSION) {
ar & make_nvp("Unknowns", p.Unknowns); ar & make_nvp("Unknowns", p.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::SavedMessage &m, const unsigned int ver ) void serialize(ArchiveT &ar, Barry::SavedMessage &m, const unsigned int ver )
{ {
ar & make_nvp("RecType", m.RecType); ar & make_nvp("RecType", m.RecType);
skipping to change at line 334 skipping to change at line 364
ar & make_nvp("MessageReplyTo", m.MessageReplyTo); ar & make_nvp("MessageReplyTo", m.MessageReplyTo);
ar & make_nvp("MessageDateSent", m.MessageDateSent); ar & make_nvp("MessageDateSent", m.MessageDateSent);
ar & make_nvp("MessageDateReceived", m.MessageDateReceived); ar & make_nvp("MessageDateReceived", m.MessageDateReceived);
ar & make_nvp("MessageTruncated", m.MessageTruncated); ar & make_nvp("MessageTruncated", m.MessageTruncated);
ar & make_nvp("MessageRead", m.MessageRead); ar & make_nvp("MessageRead", m.MessageRead);
ar & make_nvp("MessageReply", m.MessageReply); ar & make_nvp("MessageReply", m.MessageReply);
ar & make_nvp("MessageSaved", m.MessageSaved); ar & make_nvp("MessageSaved", m.MessageSaved);
ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted); ar & make_nvp("MessageSavedDeleted", m.MessageSavedDeleted);
ar & make_nvp("MessagePriority", m.MessagePriority); ar & make_nvp("MessagePriority", m.Priority);
ar & make_nvp("MessageSensitivity", m.MessageSensitivity); ar & make_nvp("MessageSensitivity", m.Sensitivity);
if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp("Unknowns", m.Unknowns);
}
}
template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Sms &m, const unsigned int ver)
{
ar & make_nvp("RecType", m.RecType);
ar & make_nvp("RecordId", m.RecordId);
ar & make_nvp("MessageStatus", m.MessageStatus);
ar & make_nvp("DeliveryStatus", m.DeliveryStatus);
ar & make_nvp("IsNew", m.IsNew);
ar & make_nvp("NewConversation", m.NewConversation);
ar & make_nvp("Saved", m.Saved);
ar & make_nvp("Deleted", m.Deleted);
ar & make_nvp("Opened", m.Opened);
ar & make_nvp("Timestamp", m.Timestamp);
ar & make_nvp("ServiceCenterTimestamp", m.ServiceCenterTimestamp);
ar & make_nvp("DataCodingScheme", m.DataCodingScheme);
ar & make_nvp("ErrorId", m.ErrorId);
ar & make_nvp("Addresses", m.Addresses);
ar & make_nvp("Body", m.Body);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp("Unknowns", m.Unknowns); ar & make_nvp("Unknowns", m.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Folder &f, const unsigned int ver) void serialize(ArchiveT &ar, Barry::Folder &f, const unsigned int ver)
{ {
ar & make_nvp("RecType", f.RecType); ar & make_nvp("RecType", f.RecType);
ar & make_nvp("RecordId", f.RecordId); ar & make_nvp("RecordId", f.RecordId);
ar & make_nvp("FolderName", f.FolderName); ar & make_nvp("FolderName", f.Name);
ar & make_nvp("FolderNumber", f.FolderNumber); ar & make_nvp("FolderNumber", f.Number);
ar & make_nvp("FolderLevel", f.FolderLevel); ar & make_nvp("FolderLevel", f.Level);
ar & make_nvp("FolderType", f.FolderType); ar & make_nvp("FolderType", f.Type);
if( ver < BARRY_POD_MAP_VERSION ) { if( ver < BARRY_POD_MAP_VERSION ) {
ar & make_nvp( "Unknowns", f.Unknowns); ar & make_nvp( "Unknowns", f.Unknowns);
} }
} }
template <class ArchiveT> template <class ArchiveT>
void serialize(ArchiveT &ar, Barry::Timezone &t, const unsigned int ver) void serialize(ArchiveT &ar, Barry::Timezone &t, const unsigned int ver)
{ {
ar & make_nvp("RecType", t.RecType); ar & make_nvp("RecType", t.RecType);
 End of changes. 13 change blocks. 
15 lines changed or deleted 75 lines changed or added


 socket.h   socket.h 
/// ///
/// \file socket.h /// \file socket.h
/// Class wrapper to encapsulate the Blackberry USB logical sock et /// Class wrapper to encapsulate the Blackberry USB logical sock et
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
skipping to change at line 36 skipping to change at line 36
#include <stdint.h> #include <stdint.h>
#include <queue> #include <queue>
#include <memory> #include <memory>
#include "router.h" #include "router.h"
// forward declarations // forward declarations
namespace Usb { class Device; } namespace Usb { class Device; }
namespace Barry { namespace Barry {
class Data; class Data;
class Packet; class Packet;
class JLPacket;
class SocketRoutingQueue; class SocketRoutingQueue;
} }
namespace Barry { namespace Barry {
class Socket; class Socket;
typedef std::auto_ptr<Socket> SocketHandle; typedef std::auto_ptr<Socket> SocketHandle;
class BXEXPORT SocketZero class BXEXPORT SocketZero
{ {
skipping to change at line 60 skipping to change at line 61
int m_writeEp, m_readEp; int m_writeEp, m_readEp;
uint8_t m_zeroSocketSequence; uint8_t m_zeroSocketSequence;
uint32_t m_sequenceId; uint32_t m_sequenceId;
// half open socket stata, for passwords // half open socket stata, for passwords
bool m_halfOpen; bool m_halfOpen;
uint32_t m_challengeSeed; uint32_t m_challengeSeed;
unsigned int m_remainingTries; unsigned int m_remainingTries;
bool m_hideSequencePacket;
bool m_resetOnClose;
private: private:
static void AppendFragment(Data &whole, const Data &fragment); static void AppendFragment(Data &whole, const Data &fragment);
static unsigned int MakeNextFragment(const Data &whole, Data &fragme nt, static unsigned int MakeNextFragment(const Data &whole, Data &fragme nt,
unsigned int offset = 0); unsigned int offset = 0);
void CheckSequence(uint16_t socket, const Data &seq); void CheckSequence(uint16_t socket, const Data &seq);
void SendOpen(uint16_t socket, Data &receive); void SendOpen(uint16_t socket, Data &receive);
void SendPasswordHash(uint16_t socket, const char *password, Data &r eceive); void SendPasswordHash(uint16_t socket, const char *password, Data &r eceive);
// Raw send and receive functions, used for all low level // Raw send and receive functions, used for all low level
// communication to the USB level. // communication to the USB level.
void RawSend(Data &send, int timeout = -1); void RawSend(Data &send, int timeout = -1);
void RawReceive(Data &receive, int timeout = -1); void RawReceive(Data &receive, int timeout = -1);
protected: protected:
bool SequencePacket(const Data &data); bool SequencePacket(const Data &data);
bool IsSequencePacketHidden() { return m_hideSequencePacket; }
public: public:
void SetResetOnClose(bool flag) { m_resetOnClose = flag; }
void HideSequencePacket(bool flag) { m_hideSequencePacket = flag; }
explicit SocketZero(SocketRoutingQueue &queue, int writeEndpoint, explicit SocketZero(SocketRoutingQueue &queue, int writeEndpoint,
uint8_t zeroSocketSequenceStart = 0); uint8_t zeroSocketSequenceStart = 0);
SocketZero(Usb::Device &dev, int writeEndpoint, int readEndpoint, SocketZero(Usb::Device &dev, int writeEndpoint, int readEndpoint,
uint8_t zeroSocketSequenceStart = 0); uint8_t zeroSocketSequenceStart = 0);
~SocketZero(); ~SocketZero();
uint8_t GetZeroSocketSequence() const { return m_zeroSocketSequence; } uint8_t GetZeroSocketSequence() const { return m_zeroSocketSequence; }
void SetRoutingQueue(SocketRoutingQueue &queue); void SetRoutingQueue(SocketRoutingQueue &queue);
void UnlinkRoutingQueue(); void UnlinkRoutingQueue();
// Send functions for socket 0 only. // Send functions for socket 0 only.
// These functions will overwrite: // These functions will overwrite:
// - the zeroSocketSequence byte *inside* the packet // - the zeroSocketSequence byte *inside* the packet
// - the socket number to 0 // - the socket number to 0
// //
void Send(Data &send, int timeout = -1); // send only void Send(Data &send, int timeout = -1); // send only
void Send(Data &send, Data &receive, int timeout = -1); // send+recv void Send(Data &send, Data &receive, int timeout = -1); // send+recv
void Send(Barry::Packet &packet, int timeout = -1); void Send(Barry::Packet &packet, int timeout = -1);
// void Receive(Data &receive, int timeout = -1); void Receive(Data &receive, int timeout = -1);
// Opens a new socket and returns a Socket object to manage it // Opens a new socket and returns a Socket object to manage it
SocketHandle Open(uint16_t socket, const char *password = 0); SocketHandle Open(uint16_t socket, const char *password = 0);
void Close(Socket &socket); void Close(Socket &socket);
}; };
// //
// Socket class // Socket class
// //
/// Encapsulates a "logical socket" in the Blackberry USB protocol. /// Encapsulates a "logical socket" in the Blackberry USB protocol.
skipping to change at line 158 skipping to change at line 166
void Send(Data &send, Data &receive, int timeout = -1); // send+recv void Send(Data &send, Data &receive, int timeout = -1); // send+recv
void Send(Barry::Packet &packet, int timeout = -1); void Send(Barry::Packet &packet, int timeout = -1);
void Receive(Data &receive, int timeout = -1); void Receive(Data &receive, int timeout = -1);
// sends the send packet down to the device, fragmenting if // sends the send packet down to the device, fragmenting if
// necessary, and returns the response in receive, defragmenting // necessary, and returns the response in receive, defragmenting
// if needed // if needed
// Blocks until response received or timed out in Usb::Device // Blocks until response received or timed out in Usb::Device
void Packet(Data &send, Data &receive, int timeout = -1); void Packet(Data &send, Data &receive, int timeout = -1);
void Packet(Barry::Packet &packet, int timeout = -1); void Packet(Barry::Packet &packet, int timeout = -1);
void Packet(Barry::JLPacket &packet, int timeout = -1);
// Use this function to send data packet instead of Packet function
// Indeed, Packet function is used to send command (and not data)
void PacketData(Data &send, Data &receive, int timeout = -1);
// some handy wrappers for the Packet() interface // some handy wrappers for the Packet() interface
void NextRecord(Data &receive); void NextRecord(Data &receive);
// Register a callback for incoming data from the device. // Register a callback for incoming data from the device.
// This function assumes that this socket is based on a socketZero // This function assumes that this socket is based on a socketZero
// that has a SocketRoutingQueue, otherwise throws logic_error. // that has a SocketRoutingQueue, otherwise throws logic_error.
void RegisterInterest(SocketRoutingQueue::SocketDataHandler handler, void *context); void RegisterInterest(SocketRoutingQueue::SocketDataHandler handler, void *context);
void UnregisterInterest(); void UnregisterInterest();
// This function is quickly written
// It's very durty :( (but it's usefull to test...)
void HideSequencePacket(bool flag) { m_zero->HideSequencePacket(flag
); }
}; };
} // namespace Barry } // namespace Barry
#endif #endif
 End of changes. 8 change blocks. 
2 lines changed or deleted 20 lines changed or added


 time.h   time.h 
/// ///
/// \file time.h /// \file time.h
/// Time related conversion routines. /// Time related conversion routines.
/// time_t is the POSIX time. /// time_t is the POSIX time.
/// min1900_t is the minutes from Jan 1, 1900 /// min1900_t is the minutes from Jan 1, 1900
/// ///
/* /*
Copyright (C) 2005-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License in the COPYING file at the See the GNU General Public License in the COPYING file at the
root directory of this project for more details. root directory of this project for more details.
*/ */
#ifndef __BARRY_TIME_H__ #ifndef __BARRY_TIME_H__
#define __BARRY_TIME_H__ #define __BARRY_TIME_H__
#include "dll.h" #include "dll.h"
#include <sys/time.h> // for struct timespec
#include <time.h> #include <time.h>
#include <stdint.h> #include <stdint.h>
// //
// Calculate the number of minutes between Jan 01, 1900 and Jan 01, 1970 // Calculate the number of minutes between Jan 01, 1900 and Jan 01, 1970
// //
// There are 17 leap years between 1900 and 1970 // There are 17 leap years between 1900 and 1970
// (1969-1900) / 4 = 17.25 // (1969-1900) / 4 = 17.25
// //
// 1900 itself is not a leap year (not divisible by 400) // 1900 itself is not a leap year (not divisible by 400)
skipping to change at line 77 skipping to change at line 78
BXEXPORT const TimeZone* GetTimeZoneTable(); BXEXPORT const TimeZone* GetTimeZoneTable();
BXEXPORT const TimeZone* GetTimeZone(unsigned short Code); BXEXPORT const TimeZone* GetTimeZone(unsigned short Code);
BXEXPORT unsigned short GetTimeZoneCode(signed short HourOffset, BXEXPORT unsigned short GetTimeZoneCode(signed short HourOffset,
signed short MinOffset = 0); signed short MinOffset = 0);
// Message time conversion stuff // Message time conversion stuff
BXEXPORT time_t DayToDate( unsigned short Day ); BXEXPORT time_t DayToDate( unsigned short Day );
BXEXPORT time_t Message2Time(uint16_t r_date, uint16_t r_time); BXEXPORT time_t Message2Time(uint16_t r_date, uint16_t r_time);
// Thread timeout creation
BXEXPORT struct timespec* ThreadTimeout(int timeout_ms, struct timespec *sp
ec);
} // namespace Barry } // namespace Barry
#endif #endif
 End of changes. 3 change blocks. 
1 lines changed or deleted 6 lines changed or added


 usbwrap.h   usbwrap.h 
/// ///
/// \file usbwrap.h /// \file usbwrap.h
/// USB API wrapper /// USB API wrapper
/// ///
/* /*
Copyright (C) 2005-2008, Chris Frey Copyright (C) 2005-2009, Chris Frey
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added


 version.h   version.h 
/// ///
/// \file version.h /// \file version.h
/// Provide access to library version information /// Provide access to library version information
/// ///
/* /*
Copyright (C) 2007-2008, Net Direct Inc. (http://www.netdirect.ca/) Copyright (C) 2007-2009, Net Direct Inc. (http://www.netdirect.ca/)
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/