moved StringUtil to FbTk

This commit is contained in:
fluxgen 2003-04-26 18:27:56 +00:00
parent ae47696324
commit 6e460803e4
3 changed files with 35 additions and 19 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//$Id: Keys.cc,v 1.26 2003/04/20 12:21:35 rathnor Exp $
//$Id: Keys.cc,v 1.27 2003/04/26 18:27:56 fluxgen Exp $
#include "Keys.hh"
@ -28,7 +28,7 @@
#include "App.hh"
#ifdef HAVE_CONFIG_H
#include "../config.h"
#include "config.h"
#endif // HAVE_CONFIG_H
@ -213,7 +213,7 @@ bool Keys::load(const char *filename) {
line++;
vector<string> val;
//Parse arguments
StringUtil::stringtok(val, linebuffer.c_str());
FbTk::StringUtil::stringtok(val, linebuffer.c_str());
//must have at least 1 argument
if (val.size() <= 0)
@ -297,7 +297,7 @@ bool Keys::load(const char *filename) {
case Keys::EXECUTE:
last_key->execcommand =
const_cast<char *>
(StringUtil::strcasestr(linebuffer.c_str(),
(FbTk::StringUtil::strcasestr(linebuffer.c_str(),
getActionStr(Keys::EXECUTE))+
strlen(getActionStr(Keys::EXECUTE)));
break;

View file

@ -61,12 +61,13 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \
Resource.hh Resource.cc \
RootTheme.hh RootTheme.cc \
Screen.cc Screen.hh \
Slit.cc Slit.hh StringUtil.cc StringUtil.hh \
Slit.cc Slit.hh \
TextButton.hh TextButton.cc \
Toolbar.cc Toolbar.hh \
ToolbarHandler.cc ToolbarHandler.hh \
ToolbarTheme.hh ToolbarTheme.cc \
WinButton.hh WinButton.cc Window.cc Window.hh \
WinButton.hh WinButton.cc \
Window.cc Window.hh \
Workspace.cc Workspace.hh \
XrmDatabaseHelper.hh FbCommands.hh FbCommands.cc LayerMenu.hh \
IntResMenuItem.hh IntResMenuItem.cc FbMenu.hh \

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: Screen.cc,v 1.137 2003/04/26 15:00:25 fluxgen Exp $
// $Id: Screen.cc,v 1.138 2003/04/26 18:27:01 fluxgen Exp $
#include "Screen.hh"
@ -1754,12 +1754,18 @@ void BScreen::initMenu() {
if (line[0] != '#') {
string key;
int pos=0;
int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']');
int err = FbTk::StringUtil::
getStringBetween(key,
line.c_str(),
'[', ']');
if (key == "begin") {
pos += err;
string label;
err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')');
err = FbTk::StringUtil::
getStringBetween(label,
line.c_str()+pos,
'(', ')');
if (err>0) {
m_rootmenu->setLabel(label.c_str());
defaultMenu = parseMenuFile(menu_file, *m_rootmenu.get(), row);
@ -1819,13 +1825,22 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
std::string str_key, str_label, str_cmd;
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, line.c_str() + parse_pos, '(', ')');
err = FbTk::StringUtil::
getStringBetween(str_label,
line.c_str() + parse_pos,
'(', ')');
if (err>0) {
parse_pos += err;
StringUtil::getStringBetween(str_cmd, line.c_str() + parse_pos, '{', '}');
FbTk::StringUtil::
getStringBetween(str_cmd,
line.c_str() + parse_pos,
'{', '}');
}
} else
continue; //read next line
@ -1880,7 +1895,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
// and insert style
FbTk::RefCount<FbTk::Command>
setstyle_cmd(new FbCommands::
SetStyleCmd(StringUtil::
SetStyleCmd(FbTk::StringUtil::
expandFilename(str_cmd)));
menu.insert(str_label.c_str(), setstyle_cmd);
@ -1913,7 +1928,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
cerr<<"Row: "<<row<<endl;
} else { // start of else 'x'
// perform shell style ~ home directory expansion
string newfile(StringUtil::expandFilename(str_label));
string newfile(FbTk::StringUtil::expandFilename(str_label));
if (newfile.size() != 0) {
FILE *submenufile = fopen(newfile.c_str(), "r");
@ -2160,7 +2175,7 @@ void BScreen::createStyleMenu(FbTk::Menu &menu,
const char *label, const char *directory) {
// perform shell style ~ home directory expansion
string stylesdir(StringUtil::expandFilename(directory ? directory : ""));
string stylesdir(FbTk::StringUtil::expandFilename(directory ? directory : ""));
I18n *i18n = I18n::instance();
struct stat statbuf;