[sword-cvs] sword/bindings/swig swbuf.i,NONE,1.1 localemgr.i,1.2,1.3 swconfig.i,1.3,1.4 swmgr.i,1.5,1.6 sword.i,1.4,1.5

sword@www.crosswire.org sword@www.crosswire.org
Sat, 28 Jun 2003 14:08:58 -0700


Update of /usr/local/cvsroot/sword/bindings/swig
In directory www:/tmp/cvs-serv13769

Modified Files:
	localemgr.i swconfig.i swmgr.i sword.i 
Added Files:
	swbuf.i 
Log Message:
fixes for Swig bindings to current CVS

--- NEW FILE: swbuf.i ---
%{
#include "swbuf.h"
using namespace sword;
%}

class SWBuf {
public:
  	SWBuf(const char *initVal = 0);
	SWBuf(char initVal);
	SWBuf(const SWBuf &other);
	virtual ~SWBuf();

	inline void setFillByte(char ch) { fillByte = ch; }
	inline char getFillByte() { return fillByte; }
	inline const char *c_str() const;
	inline char &charAt(unsigned int pos) { return ((pos <= (unsigned int)(end - buf)) ? buf[pos] : nullStr[0]); }
	inline unsigned int size() const { return length(); }
	inline unsigned int length() const { return end - buf; }

	void set(const char *newVal);
	void set(const SWBuf &newVal);
	void setSize(unsigned int len);
	void append(const char *str, int max = -1);
	inline void append(const SWBuf &str, int max = -1) { append(str.c_str(), max); }
	inline void append(char ch);
	void appendFormatted(const char *format, ...);

	inline char *getRawData();

	/*
	inline operator const char *() const { return c_str(); }
	inline char &operator[](unsigned int pos) { return charAt(pos); }
	inline char &operator[](int pos) { return charAt((unsigned int)pos); }
	inline SWBuf &operator =(const char *newVal) { set(newVal); return *this; }
	inline SWBuf &operator =(const SWBuf &other) { set(other); return *this; }
	inline SWBuf &operator +=(const char *str) { append(str); return *this; }
	inline SWBuf &operator +=(char ch) { append(ch); return *this; }
	inline SWBuf &operator -=(unsigned int len) { setSize(length()-len); return *this; }
	inline SWBuf &operator --(int) { operator -=(1); return *this; }
	inline SWBuf operator +(const SWBuf &other) const {
		SWBuf retVal = buf;
		retVal += other;
		return retVal;
	}
	inline SWBuf operator +(char ch) const { return (*this) + SWBuf(ch); }
	*/

	int compare(const SWBuf &other) const;

	/*
	inline bool operator ==(const SWBuf &other) const;
	inline bool operator !=(const SWBuf &other) const;
	inline bool operator > (const SWBuf &other) const;
	inline bool operator < (const SWBuf &other) const;
	inline bool operator <=(const SWBuf &other) const;
	inline bool operator >=(const SWBuf &other) const;

	inline bool operator ==(const char *other) const;
	inline bool operator !=(const char *other) const;
	inline bool operator > (const char *other) const;
	inline bool operator < (const char *other) const;
	inline bool operator <=(const char *other) const;
	inline bool operator >=(const char *other) const;
	*/
};

Index: localemgr.i
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/localemgr.i,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** localemgr.i	27 Nov 2002 21:20:35 -0000	1.2
--- localemgr.i	28 Jun 2003 21:08:56 -0000	1.3
***************
*** 1,5 ****
  %{
  #include <localemgr.h>
- #include <string>
  
  using namespace std;
--- 1,4 ----
***************
*** 7,11 ****
  %}
  
! typedef map < string, SWLocale *, less < string > >LocaleMap;
  
  class LocaleMgr {
--- 6,10 ----
  %}
  
! typedef map < SWBuf, SWLocale *, less < string > >LocaleMap;
  
  class LocaleMgr {
***************
*** 14,18 ****
    virtual ~LocaleMgr ();
    virtual SWLocale *getLocale (const char *name);
!   virtual std::list < std::string > getAvailableLocales ();
    //virtual const char *translate (const char *name, const char *text);
    virtual const char *getDefaultLocaleName();
--- 13,17 ----
    virtual ~LocaleMgr ();
    virtual SWLocale *getLocale (const char *name);
!   virtual std::list < SWBuf > getAvailableLocales ();
    //virtual const char *translate (const char *name, const char *text);
    virtual const char *getDefaultLocaleName();

Index: swconfig.i
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/swconfig.i,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** swconfig.i	27 Nov 2002 21:20:35 -0000	1.3
--- swconfig.i	28 Jun 2003 21:08:56 -0000	1.4
***************
*** 17,27 ****
  
  
! typedef multimapwithdefault < std::string, string, less < std::string > > ConfigEntMap;
! typedef std::map < std::string, ConfigEntMap, less < std::string > > SectionMap;
  
  class SWConfig {
  public:
    //member data
!   std::string filename;
    SectionMap Sections;
  
--- 17,27 ----
  
  
! typedef multimapwithdefault < SWBuf, SWBuf, std::less < SWBuf > > ConfigEntMap;
! typedef std::map < SWBuf, ConfigEntMap, std::less < SWBuf > > SectionMap;
  
  class SWConfig {
  public:
    //member data
!   SWBuf filename;
    SectionMap Sections;
  

Index: swmgr.i
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/swmgr.i,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** swmgr.i	24 Feb 2003 06:59:15 -0000	1.5
--- swmgr.i	28 Jun 2003 21:08:56 -0000	1.6
***************
*** 4,10 ****
  %}
  
! typedef map < string, SWModule *, less < string > > ModMap;
! typedef list < string > OptionsList;
! typedef map < string, SWFilter * > FilterMap;
  
  class SWMgr {
--- 4,10 ----
  %}
  
! typedef map < SWBuf, SWModule *, less < SWBuf > > ModMap;
! typedef list < SWBuf > OptionsList;
! typedef map < SWBuf, SWFilter * > FilterMap;
  
  class SWMgr {

Index: sword.i
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/swig/sword.i,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sword.i	2 Oct 2002 23:40:10 -0000	1.4
--- sword.i	28 Jun 2003 21:08:56 -0000	1.5
***************
*** 49,50 ****
--- 49,52 ----
  %include "lzsscompress.i"
  %include "zipcompress.i"
+ 
+ %include "swbuf.i"
\ No newline at end of file