moved StringUtil to FbTk

This commit is contained in:
fluxgen 2003-04-26 18:58:30 +00:00
parent a01e77133e
commit 6125c24401
4 changed files with 22 additions and 15 deletions

View file

@ -12,14 +12,17 @@ libFbTk_a_SOURCES = App.hh App.cc Color.cc Color.hh Command.hh \
FbWindow.hh FbWindow.cc Font.cc Font.hh FontImp.hh \
ImageControl.hh ImageControl.cc \
MacroCommand.hh MacroCommand.cc \
Menu.hh Menu.cc MenuItem.hh MenuItem.cc MenuTheme.hh MenuTheme.cc NotCopyable.hh \
Menu.hh Menu.cc MenuItem.hh MenuItem.cc \
MenuTheme.hh MenuTheme.cc NotCopyable.hh \
RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \
Text.hh Text.cc \
Texture.cc Texture.hh TextureRender.hh TextureRender.cc Theme.hh Theme.cc Timer.hh Timer.cc \
Texture.cc Texture.hh TextureRender.hh TextureRender.cc \
Theme.hh Theme.cc Timer.hh Timer.cc \
XFontImp.cc XFontImp.hh \
Button.hh Button.cc \
Layer.hh LayerItem.hh MultLayers.cc MultLayers.hh \
XLayer.cc XLayer.hh XLayerItem.cc XLayerItem.hh \
StringUtil.hh StringUtil.cc \
Subject.hh Subject.cc Observer.hh Observer.cc \
Transparent.hh Transparent.cc \
FbPixmap.hh FbPixmap.cc \

View file

@ -1,5 +1,5 @@
// XmbFontImp.cc for FbTk fluxbox toolkit
// Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org)
// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
@ -19,14 +19,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: XmbFontImp.cc,v 1.5 2003/02/17 23:36:43 fluxgen Exp $
// $Id: XmbFontImp.cc,v 1.6 2003/04/26 18:57:51 fluxgen Exp $
#include "XmbFontImp.hh"
#include "App.hh"
//!! TODO: Change this
#include "../StringUtil.hh"
#include "StringUtil.hh"
#ifdef HAVE_CONFIG_H
#include "config.h"
@ -104,7 +102,7 @@ const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) {
buf[bufsiz-1] = 0;
buf[bufsiz-2] = '*';
while((v = va_arg(va, char *)) != 0) {
p = StringUtil::strcasestr(pattern, v);
p = FbTk::StringUtil::strcasestr(pattern, v);
if (p) {
std::strncpy(buf, p+1, bufsiz-2);
p2 = strchr(buf, '-');

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Remember.cc,v 1.7 2003/04/26 14:36:21 rathnor Exp $
// $Id: Remember.cc,v 1.8 2003/04/26 18:56:39 fluxgen Exp $
#include "Remember.hh"
#include "StringUtil.hh"
@ -207,10 +207,12 @@ int Remember::parseApp(ifstream &file, Application *a) {
if (line[0] != '#') { //the line is commented
int parse_pos = 0, err = 0;
string str_key, str_label;
err = StringUtil::getStringBetween(str_key, line.c_str(), '[', ']');
err = FbTk::StringUtil::getStringBetween(str_key,
line.c_str(),
'[', ']');
if (err > 0 ) {
parse_pos += err;
err = StringUtil::getStringBetween(str_label,
err = FbTk::StringUtil::getStringBetween(str_label,
line.c_str() + parse_pos,
'{', '}');
if (err>0) {
@ -308,12 +310,16 @@ void Remember::load() {
continue;
string key;
int pos=0;
int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']');
int err = FbTk::StringUtil::getStringBetween(key,
line.c_str(),
'[', ']');
if (err >0 && key == "app") {
pos += err;
string label;
err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')');
err = FbTk::StringUtil::getStringBetween(label,
line.c_str()+pos,
'(', ')');
if (err>0) {
Application *a;
Apps::iterator i = apps.find(label);

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Workspace.cc,v 1.55 2003/04/25 11:22:40 fluxgen Exp $
// $Id: Workspace.cc,v 1.56 2003/04/26 18:57:10 fluxgen Exp $
#include "Workspace.hh"
@ -432,7 +432,7 @@ bool Workspace::loadGroups(const std::string &filename) {
string line;
vector<string> names;
getline(infile, line);
StringUtil::stringtok(names, line);
FbTk::StringUtil::stringtok(names, line);
m_groups.push_back(names);
}