Permalink
Browse files

Remove inline function

  • Loading branch information...
1 parent 621d545 commit d6f91cdec7a65179eed8face7209168d0cbddc14 @gierschv gierschv committed Sep 4, 2011
Showing with 329 additions and 322 deletions.
  1. +36 −32 apps/gsmsmsstore.cc
  2. +30 −30 gsmlib/gsm_cb.cc
  3. +8 −8 gsmlib/gsm_sorted_phonebook_base.cc
  4. +5 −0 gsmlib/gsm_util.cc
  5. +1 −4 gsmlib/gsm_util.h
  6. +3 −3 intl/Makefile
  7. +246 −245 po/gsmlib.pot
View
@@ -270,26 +270,28 @@ int main(int argc, char *argv[])
// start accessing source store or file if required by operation
if (operation == CopyOp || operation == BackupOp || operation == ListOp)
- if (source == "-")
- sourceStore = new SortedSMSStore(true);
- else if (isFile(source))
- sourceStore = new SortedSMSStore(source);
- else
{
- if (storeName == "")
- throw GsmException(_("store name must be given"), ParameterError);
-
- sourceMeTa = new MeTa(new
+ if (source == "-")
+ sourceStore = new SortedSMSStore(true);
+ else if (isFile(source))
+ sourceStore = new SortedSMSStore(source);
+ else
+ {
+ if (storeName == "")
+ throw GsmException(_("store name must be given"), ParameterError);
+
+ sourceMeTa = new MeTa(new
#ifdef WIN32
- Win32SerialPort
+ Win32SerialPort
#else
- UnixSerialPort
+ UnixSerialPort
#endif
- (source,
- baudrate == "" ? DEFAULT_BAUD_RATE :
- baudRateStrToSpeed(baudrate), initString,
- swHandshake));
- sourceStore = new SortedSMSStore(sourceMeTa->getSMSStore(storeName));
+ (source,
+ baudrate == "" ? DEFAULT_BAUD_RATE :
+ baudRateStrToSpeed(baudrate), initString,
+ swHandshake));
+ sourceStore = new SortedSMSStore(sourceMeTa->getSMSStore(storeName));
+ }
}
// make sure destination file exists if specified
@@ -302,26 +304,28 @@ int main(int argc, char *argv[])
// start accessing destination store or file
if (operation == CopyOp || operation == BackupOp || operation == AddOp ||
operation == DeleteOp)
- if (destination == "-")
- destStore = new SortedSMSStore(false);
- else if (isFile(destination))
- destStore = new SortedSMSStore(destination);
- else
{
- if (storeName == "")
- throw GsmException(_("store name must be given"), ParameterError);
-
- destMeTa = new MeTa(new
+ if (destination == "-")
+ destStore = new SortedSMSStore(false);
+ else if (isFile(destination))
+ destStore = new SortedSMSStore(destination);
+ else
+ {
+ if (storeName == "")
+ throw GsmException(_("store name must be given"), ParameterError);
+
+ destMeTa = new MeTa(new
#ifdef WIN32
- Win32SerialPort
+ Win32SerialPort
#else
- UnixSerialPort
+ UnixSerialPort
#endif
- (destination,
- baudrate == "" ? DEFAULT_BAUD_RATE :
- baudRateStrToSpeed(baudrate), initString,
- swHandshake));
- destStore = new SortedSMSStore(destMeTa->getSMSStore(storeName));
+ (destination,
+ baudrate == "" ? DEFAULT_BAUD_RATE :
+ baudRateStrToSpeed(baudrate), initString,
+ swHandshake));
+ destStore = new SortedSMSStore(destMeTa->getSMSStore(storeName));
+ }
}
// now do the actual work
View
@@ -16,30 +16,33 @@
#include <gsmlib/gsm_sysdep.h>
#include <gsmlib/gsm_cb.h>
#include <gsmlib/gsm_nls.h>
-#include <strstream>
+#include <sstream>
using namespace gsmlib;
// local constants
-static const string dashes =
+static const std::string dashes =
"---------------------------------------------------------------------------";
// CBDataCodingScheme members
CBDataCodingScheme::CBDataCodingScheme(unsigned char dcs) : _dcs(dcs)
{
if ((_dcs & 0xf0) <= 0x30) // bits 7..4 in the range 0000..0011
- if ((_dcs & 0x30) == 0)
- _language = (Language)_dcs;
+ {
+ if ((_dcs & 0x30) == 0)
+ _language = (Language)_dcs;
+ }
else
_language = Unknown;
}
-string CBDataCodingScheme::toString() const
+std::string CBDataCodingScheme::toString() const
{
- string result;
- if (compressed()) result += _("compressed ");
+ std::string result;
+ if (compressed())
+ result += _("compressed ");
switch (getLanguage())
{
case German:
@@ -103,7 +106,7 @@ string CBDataCodingScheme::toString() const
// CBMessage members
-CBMessage::CBMessage(string pdu) throw(GsmException)
+CBMessage::CBMessage(std::string pdu) throw(GsmException)
{
SMSDecoder d(pdu);
_messageCode = d.getInteger(6) << 4;
@@ -132,44 +135,41 @@ CBMessage::CBMessage(string pdu) throw(GsmException)
}
}
-string CBMessage::toString() const
+std::string CBMessage::toString() const
{
- ostrstream os;
- os << dashes << endl
- << _("Message type: CB") << endl
+ std::ostringstream os;
+ os << dashes << std::endl
+ << _("Message type: CB") << std::endl
<< _("Geographical scope: ");
switch (_geographicalScope)
{
case CellWide:
- os << "Cell wide" << endl;
+ os << "Cell wide" << std::endl;
break;
case PLMNWide:
- os << "PLMN wide" << endl;
+ os << "PLMN wide" << std::endl;
break;
case LocationAreaWide:
- os << "Location area wide" << endl;
+ os << "Location area wide" << std::endl;
break;
case CellWide2:
- os << "Cell wide (2)" << endl;
+ os << "Cell wide (2)" << std::endl;
break;
}
// remove trailing \r characters for output
- string data = _data;
- string::iterator i;
+ std::string data = _data;
+ std::string::iterator i;
for (i = data.end(); i > data.begin() && *(i - 1) == '\r';
--i);
data.erase(i, data.end());
- os << _("Message Code: ") << _messageCode << endl
- << _("Update Number: ") << _updateNumber << endl
- << _("Message Identifer: ") << _messageIdentifier << endl
- << _("Data coding scheme: ") << _dataCodingScheme.toString() << endl
- << _("Total page number: ") << _totalPageNumber << endl
- << _("Current page number: ") << _currentPageNumber << endl
- << _("Data: '") << data << "'" << endl
- << dashes << endl << endl << ends;
- char *ss = os.str();
- string result(ss);
- delete[] ss;
- return result;
+ os << _("Message Code: ") << _messageCode << std::endl
+ << _("Update Number: ") << _updateNumber << std::endl
+ << _("Message Identifer: ") << _messageIdentifier << std::endl
+ << _("Data coding scheme: ") << _dataCodingScheme.toString() << std::endl
+ << _("Total page number: ") << _totalPageNumber << std::endl
+ << _("Current page number: ") << _currentPageNumber << std::endl
+ << _("Data: '") << data << "'" << std::endl
+ << dashes << std::endl << std::endl << std::ends;
+ return os.str();
}
@@ -27,7 +27,7 @@ using namespace gsmlib;
// PhonebookEntryBase members
-void PhonebookEntryBase::set(string telephone, string text, int index,
+void PhonebookEntryBase::set(std::string telephone, std::string text, int index,
bool useIndex)
throw(GsmException)
{
@@ -49,12 +49,12 @@ bool PhonebookEntryBase::operator==(const PhonebookEntryBase &e) const
(! (_useIndex || e._useIndex) || _index == e._index);
}
-string PhonebookEntryBase::text() const throw(GsmException)
+std::string PhonebookEntryBase::text() const throw(GsmException)
{
return _text;
}
-string PhonebookEntryBase::telephone() const throw(GsmException)
+std::string PhonebookEntryBase::telephone() const throw(GsmException)
{
return _telephone;
}
@@ -85,27 +85,27 @@ PhonebookEntryBase &PhonebookEntryBase::operator=(const PhonebookEntryBase &e)
// CustomPhonebookRegistry members
-map<string, CustomPhonebookFactory*>
+std::map<std::string, CustomPhonebookFactory*>
*CustomPhonebookRegistry::_factoryList = NULL;
void CustomPhonebookRegistry::
-registerCustomPhonebookFactory(string backendName,
+registerCustomPhonebookFactory(std::string backendName,
CustomPhonebookFactory *factory)
throw(GsmException)
{
if (_factoryList == NULL)
- _factoryList = new map<string, CustomPhonebookFactory*>;
+ _factoryList = new std::map<std::string, CustomPhonebookFactory*>;
backendName = lowercase(backendName);
if (_factoryList->find(backendName) != _factoryList->end())
throw GsmException(stringPrintf(_("backend '%s' already registered"),
backendName.c_str()), ParameterError);
}
SortedPhonebookRef CustomPhonebookRegistry::
-createPhonebook(string backendName, string source) throw(GsmException)
+createPhonebook(std::string backendName, std::string source) throw(GsmException)
{
if (_factoryList == NULL)
- _factoryList = new map<string, CustomPhonebookFactory*>;
+ _factoryList = new std::map<std::string, CustomPhonebookFactory*>;
backendName = lowercase(backendName);
if (_factoryList->find(backendName) == _factoryList->end())
throw GsmException(stringPrintf(_("backend '%s' not registered"),
View
@@ -379,3 +379,8 @@ void gsmlib::reportProgress(int part, int total)
if (progressObject != NULL)
progressObject->reportProgress(part, total);
}
+
+bool gsmlib::isSet(std::vector<bool> &b, unsigned int bit)
+{
+ return b.size() > bit && b[bit];
+}
View
@@ -129,10 +129,7 @@ namespace gsmlib
std::string removeWhiteSpace(std::string s);
// return true if bit is set in vector<bool>
- bool isSet(std::vector<bool> &b, unsigned int bit)
- {
- return b.size() > bit && b[bit];
- }
+ bool isSet(std::vector<bool> &b, unsigned int bit);
// return true if filename refers to a file
// throws exception if filename is neither file nor device
View
@@ -25,7 +25,7 @@ top_srcdir = ..
top_builddir = ..
-prefix = /usr
+prefix = /usr/local
exec_prefix = ${prefix}
transform = s,x,x,
libdir = $(exec_prefix)/lib
@@ -37,14 +37,14 @@ gettextsrcdir = ${prefix}/share/gettext/intl
aliaspath = $(localedir):.
subdir = intl
-INSTALL = /usr/bin/install -c
+INSTALL = /bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
MKINSTALLDIRS = $(top_builddir)/scripts/mkinstalldirs
l = @l@
AR = ar
-CC = i486-linux-gnu-gcc
+CC = gcc
LIBTOOL = $(SHELL) $(top_builddir)/libtool
RANLIB = ranlib
Oops, something went wrong.

0 comments on commit d6f91cd

Please sign in to comment.