summaryrefslogtreecommitdiff
path: root/src/utilfuns/swbuf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilfuns/swbuf.cpp')
-rw-r--r--src/utilfuns/swbuf.cpp63
1 files changed, 2 insertions, 61 deletions
diff --git a/src/utilfuns/swbuf.cpp b/src/utilfuns/swbuf.cpp
index 9c4908b..e9a8109 100644
--- a/src/utilfuns/swbuf.cpp
+++ b/src/utilfuns/swbuf.cpp
@@ -2,7 +2,7 @@
*
* swbuf.cpp - used as a transport and utility for data buffers
*
- * $Id: swbuf.cpp 2980 2013-09-14 21:51:47Z scribe $
+ * $Id: swbuf.cpp 3515 2017-11-01 11:38:09Z scribe $
*
* Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
@@ -32,38 +32,6 @@ SWORD_NAMESPACE_START
char *SWBuf::nullStr = (char *)"";
-/******************************************************************************
-* SWBuf Constructor - Creates an empty SWBuf object or an SWBuf initialized
-* to a value from a const char *
-*
-*/
-SWBuf::SWBuf(const char *initVal, unsigned long initSize) {
- init(initSize);
- if (initVal)
- set(initVal);
-}
-
-/******************************************************************************
-* SWBuf Constructor - Creates an SWBuf initialized
-* to a value from another SWBuf
-*
-*/
-SWBuf::SWBuf(const SWBuf &other, unsigned long initSize) {
- init(initSize);
- set(other);
-}
-
-/******************************************************************************
-* SWBuf Constructor - Creates an SWBuf initialized
-* to a value from a char
-*
-*/
-SWBuf::SWBuf(char initVal, unsigned long initSize) {
- init(initSize+1);
- *buf = initVal;
- end = buf+1;
- *end = 0;
-}
/*
SWBuf::SWBuf(unsigned long initSize) {
@@ -97,33 +65,6 @@ SWBuf &SWBuf::setFormatted(const char *format, ...) {
}
/******************************************************************************
-* SWBuf::append - appends a value to the current value of this SWBuf
-*
-*/
-SWBuf &SWBuf::append(const char *str, long max) {
-// if (!str) //A null string was passed
-// return;
- if (max < 0)
- max = strlen(str);
- assureMore(max+1);
- for (;((max)&&(*str));max--)
- *end++ = *str++;
- *end = 0;
- return *this;
-}
-
-/******************************************************************************
-* SWBuf::setSize - Size this buffer to a specific length
-*/
-void SWBuf::setSize(unsigned long len) {
- assureSize(len+1);
- if ((unsigned)(end - buf) < len)
- memset(end, fillByte, len - (end-buf));
- end = buf + len;
- *end = 0;
-}
-
-/******************************************************************************
* SWBuf::appendFormatted - appends formatted strings to the current value of this SWBuf
* WARNING: This function can only write at most
* JUNKBUFSIZE to the string per call.
@@ -151,7 +92,7 @@ void SWBuf::insert(unsigned long pos, const char* str, unsigned long start, sign
// return;
str += start;
- int len = (max > -1) ? max : strlen(str);
+ int len = (int)((max > -1) ? max : strlen(str));
if (!len || (pos > length())) //nothing to do, return
return;