Moved strip_whitespace_edges() to pbd/whitespace.h

Gtkmm2ext::Prompter::get_result() calls strip_whitespace_edges(), so you don't have to.
Removed unused/unecessary/forgotten headers from libpbd.


git-svn-id: svn://localhost/trunk/ardour2@270 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Taybin Rutkin 2006-01-13 19:48:55 +00:00
parent f5aef674d3
commit 6817b59169
28 changed files with 116 additions and 595 deletions

View File

@ -29,50 +29,51 @@
#include <pbd/error.h>
#include <pbd/stl_delete.h>
#include <pbd/whitespace.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/selector.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/stop_signal.h>
#include <gtkmm2ext/bindable_button.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/selector.h>
#include <gtkmm2ext/stop_signal.h>
#include <gtkmm2ext/utils.h>
#include <ardour/session.h>
#include <ardour/session_playlist.h>
#include <ardour/audioplaylist.h>
#include <ardour/diskstream.h>
#include <ardour/utils.h>
#include <ardour/playlist.h>
#include <ardour/ladspa_plugin.h>
#include <ardour/insert.h>
#include <ardour/ladspa_plugin.h>
#include <ardour/location.h>
#include <ardour/panner.h>
#include <ardour/playlist.h>
#include <ardour/session.h>
#include <ardour/session_playlist.h>
#include <ardour/utils.h>
#include "ardour_ui.h"
#include "public_editor.h"
#include "audio_time_axis.h"
#include "streamview.h"
#include "simplerect.h"
#include "playlist_selector.h"
#include "plugin_selector.h"
#include "plugin_ui.h"
#include "regionview.h"
#include "automation_gain_line.h"
#include "automation_pan_line.h"
#include "automation_time_axis.h"
#include "redirect_automation_time_axis.h"
#include "gain_automation_time_axis.h"
#include "pan_automation_time_axis.h"
#include "redirect_automation_line.h"
#include "selection.h"
#include "point_selection.h"
#include "enums.h"
#include "utils.h"
#include "keyboard.h"
#include "rgb_macros.h"
#include "prompter.h"
#include "crossfade_view.h"
#include "gui_thread.h"
#include "canvas_impl.h"
#include "crossfade_view.h"
#include "enums.h"
#include "gain_automation_time_axis.h"
#include "gui_thread.h"
#include "keyboard.h"
#include "pan_automation_time_axis.h"
#include "playlist_selector.h"
#include "plugin_selector.h"
#include "plugin_ui.h"
#include "point_selection.h"
#include "prompter.h"
#include "public_editor.h"
#include "redirect_automation_line.h"
#include "redirect_automation_time_axis.h"
#include "regionview.h"
#include "rgb_macros.h"
#include "selection.h"
#include "simplerect.h"
#include "streamview.h"
#include "utils.h"
#include <ardour/audio_track.h>
@ -834,7 +835,7 @@ AudioTimeAxisView::rename_current_playlist ()
prompter.set_initial_text (pl->name());
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
prompter.get_result (name);
pl->set_name (name);
break;
@ -873,7 +874,7 @@ AudioTimeAxisView::use_copy_playlist ()
prompter.show_all ();
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
prompter.get_result (name);
ds->use_copy_playlist ();
pl = ds->playlist();
@ -903,7 +904,7 @@ AudioTimeAxisView::use_new_playlist ()
prompter.set_initial_text (new_name);
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
prompter.get_result (name);
ds->use_new_playlist ();
pl = ds->playlist();

View File

@ -658,7 +658,7 @@ ConnectionEditor::new_connection (bool for_input)
prompter.done.connect (Gtk::Main::quit.slot());
switch (prompter.run()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
prompter.get_result (name);
push_at_front = true;
if (name.length()) {

View File

@ -88,7 +88,7 @@ Editor::new_edit_group ()
prompter.show_all ();
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
prompter.get_result (result);
if (result.length()) {
session->add_edit_group (result);

View File

@ -4464,7 +4464,7 @@ Editor::mouse_rename_region (ArdourCanvas::Item* item, GdkEvent* event)
prompter.set_initial_text (clicked_regionview->region.name());
prompter.show_all ();
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
string str;
prompter.get_result(str);
if (str.length()) {

View File

@ -112,7 +112,7 @@ Editor::name_selection ()
p.show_all ();
switch (p.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
string name;
p.get_result (name);
if (name.length()) {

View File

@ -31,8 +31,6 @@
#include <pbd/error.h>
#include <pbd/textreceiver.h>
#include <pbd/platform.h>
#include <pbd/platform_factory.h>
#include <pbd/failed_constructor.h>
#include <pbd/pthread_utils.h>

View File

@ -690,7 +690,7 @@ Mixer_UI::new_mix_group ()
prompter.show_all ();
switch (prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
prompter.get_result (result);
if (result.length()) {
session->add_mix_group (result);

View File

@ -18,6 +18,8 @@
$Id$
*/
#include <pbd/whitespace.h>
#include <ardour/session.h>
#include <ardour/audioengine.h>
#include <ardour/configuration.h>

View File

@ -19,9 +19,6 @@
*/
#include "prompter.h"
#include "ardour_ui.h"
using namespace sigc;
ArdourPrompter::ArdourPrompter (bool modal)
: Gtkmm2ext::Prompter (modal)

View File

@ -740,10 +740,9 @@ RouteUI::route_rename ()
switch (name_prompter.run ()) {
case GTK_RESPONSE_ACCEPT:
name_prompter.get_result (result);
if (result.length()) {
strip_whitespace_edges (result);
case Gtk::RESPONSE_ACCEPT:
name_prompter.get_result (result);
if (result.length()) {
_route.set_name (result, this);
}
break;

View File

@ -20,7 +20,7 @@
*/
#include <map>
#include <errno.h>
#include <cerrno>
#include <sndfile.h>
@ -34,8 +34,9 @@
#include <ardour/sndfile_helpers.h>
#include <ardour/sndfilesource.h>
#include "sfdb_ui.h"
#include "gui_thread.h"
#include "prompter.h"
#include "sfdb_ui.h"
#include "i18n.h"
@ -235,7 +236,24 @@ SoundFileBox::stop_btn_clicked ()
void
SoundFileBox::add_field_clicked ()
{}
{
ArdourPrompter prompter (true);
string name;
prompter.set_prompt (_("Name for field"));
switch (prompter.run ()) {
case Gtk::RESPONSE_ACCEPT:
cout << name << endl;
prompter.get_result (name);
Library->add_field (name);
Library->save_changes ();
break;
default:
break;
}
}
void
SoundFileBox::remove_field_clicked ()

View File

@ -147,32 +147,6 @@ atof (const string& s)
return atof (s.c_str());
}
void
strip_whitespace_edges (string& str)
{
string::size_type i;
string::size_type len;
string::size_type s;
len = str.length();
for (i = 0; i < len; ++i) {
if (isgraph (str[i])) {
break;
}
}
s = i;
for (i = len - 1; i >= 0; --i) {
if (isgraph (str[i])) {
break;
}
}
str = str.substr (s, (i - s) + 1);
}
vector<string>
internationalize (const char **array)
{

View File

@ -55,7 +55,6 @@ std::string fit_to_pixels (const std::string &, int pixel_width, const std::stri
int atoi (const std::string&);
double atof (const std::string&);
void strip_whitespace_edges (std::string& str);
void url_decode (std::string&);
gint just_hide_it (GdkEventAny*, Gtk::Window*);
void allow_keyboard_focus (bool);

View File

@ -26,6 +26,7 @@
#include <pbd/error.h>
#include <pbd/stl_delete.h>
#include <pbd/whitespace.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/selector.h>
@ -361,7 +362,7 @@ VisualTimeAxis::start_time_axis_rename()
name_prompter->show_all() ;
switch (name_prompter->run ()) {
case GTK_RESPONSE_ACCEPT:
case Gtk::RESPONSE_ACCEPT:
string result;
name_prompter->get_result (result);
if (editor.get_named_time_axis(result) != 0) {

View File

@ -21,15 +21,15 @@
#ifndef __pbd_gtkmm_bindable_button_h__
#define __pbd_gtkmm_bindable_button_h__
#include <string>
#include <gtkmm2ext/stateful_button.h>
#include <gtkmm2ext/popup.h>
namespace MIDI {
class Controllable;
}
namespace Gtkmm2ext {
class BindableToggleButton : public Gtk::ToggleButton
@ -41,7 +41,7 @@ class BindableToggleButton : public Gtk::ToggleButton
//- You won't be able
//- to add a widget in this button since it already has a {\class Gtk_Label}
//- in it.
explicit BindableToggleButton(MIDI::Controllable *, const string &label);
explicit BindableToggleButton(MIDI::Controllable *, const std::string &label);
virtual ~BindableToggleButton() {}

View File

@ -53,7 +53,7 @@ class Prompter : public Gtk::Dialog
void change_labels (std::string ok, std::string cancel);
void get_result (std::string &str);
void get_result (std::string &str, bool strip=true);
protected:
Gtk::Entry& the_entry() { return entry; }

View File

@ -20,6 +20,8 @@
#include <string>
#include <pbd/whitespace.h>
#include <gtkmm/stock.h>
#include <gtkmm2ext/prompter.h>
@ -74,8 +76,10 @@ Prompter::change_labels (string okstr, string cancelstr)
}
void
Prompter::get_result (string &str)
Prompter::get_result (string &str, bool strip)
{
str = entry.get_text ();
if (strip) {
strip_whitespace_edges (str);
}
}

View File

@ -7,13 +7,12 @@ Import('env libraries')
pbd3 = env.Copy()
domain = 'libpbd'
pbd3.Append(DOMAIN=domain,MAJOR=3,MINOR=1,MICRO=0)
pbd3.Append(DOMAIN=domain,MAJOR=3,MINOR=2,MICRO=0)
pbd3_files = Split("""
basename.cc
dirname.cc
dmalloc.cc
ftw.cc
mountpoint.cc
pathscanner.cc
pool.cc
@ -25,6 +24,7 @@ transmitter.cc
undo.cc
unescape.cc
version.cc
whitespace.cc
xml++.cc
""")

View File

@ -1,220 +0,0 @@
/*
Copyright (c) 2003 by Joel Baker.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Author nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#include <string>
#include <sys/types.h> /* Because fts(3) says so */
#include <sys/stat.h>
#include <fts.h>
#include <alloca.h>
#include <unistd.h> /* We want strcpy */
#include <cerrno> /* Because errno is our friend */
#ifndef __USE_XOPEN_EXTENDED /* We need nftw values, since we implement it */
#define __USE_XOPEN_EXTENDED
#endif
#include <pbd/ftw.h>
/* I like symbolic values - this is only used in this file. */
enum __ftw_modes {
MODE_FTW,
MODE_NFTW
};
/* Prototype this so that we can have it later */
static int __ftw_core(const char *, void*, int, int, enum __ftw_modes);
/*
* The external function calls are really just wrappers around __ftw_core,
* since the work they do is 90% the same.
*/
int ftw (const char *dir, __ftw_func_t func, int descr) {
return __ftw_core(dir, (void*)func, descr, 0, MODE_FTW);
}
int nftw (const char *dir, __nftw_func_t func, int descr, int flags) {
return __ftw_core(dir, (void*)func, descr, flags, MODE_NFTW);
}
/*
typedef int (*__ftw_func_t) \
(const char *file, const struct stat status, int flag);
typedef int (*__nftw_func_t) \
(const char *file, const struct stat status, int flag, struct FTW detail);
*/
static int __ftw_core(const char *dir, void* func, int descr, int flags,
enum __ftw_modes mode) {
FTS *hierarchy = 0;
FTSENT *entry = 0;
int fts_options;
char *paths[2];
int ftw_flag = 0, func_ret = 0;
struct FTW ftw_st;
int skip_entry;
__ftw_func_t ftw_func;
__nftw_func_t nftw_func;
/* We need at least one descriptor to call fts */
if (descr < 1) {
errno = EINVAL;
return -1;
}
/* Decide which mode we're running in, and set the FTS options suitably. */
if (MODE_NFTW == mode) { /* NFTW mode, with all the bells and whistles. */
fts_options = (flags & FTW_PHYS) ? FTS_PHYSICAL : FTS_LOGICAL;
fts_options |= (flags & FTW_CHDIR) ? FTS_NOCHDIR : 0;
fts_options |= (flags & FTW_MOUNT) ? FTS_XDEV : 0;
} else { /* We must be in FTW mode. Nothing else makes sense. */
fts_options = FTS_LOGICAL;
}
/* FTW gets a const char *, but FTS expects a null-term array of them. */
if (!(paths[0] = (char*) alloca(strlen(dir) + 1))) {
errno = ENOMEM; /* This is stack... we probably just died anyway. */
return -1;
}
strcpy(paths[0], dir);
paths[1] = 0; /* null */
/* Open the file hierarchy. */
if (!(hierarchy = fts_open(paths, fts_options, 0))) {
if (EACCES == errno) {
return 0;
} else {
return -1;
}
}
/* The main loop. Is it not nifty? Worship the loop. */
bool first = true;
while ((entry = fts_read(hierarchy))) {
skip_entry = 0;
std::string path_name = entry->fts_path;
switch (entry->fts_info) {
case FTS_D:
if ((MODE_NFTW != mode) || !(flags & FTW_DEPTH)) {
if (first) {
path_name = path_name.substr(0, path_name.size() - 1);
first = false;
}
ftw_flag = FTW_D;
} else {
skip_entry = 1;
}
break;
case FTS_DNR:
ftw_flag = FTW_DNR;
break;
case FTS_F:
ftw_flag = FTW_F;
break;
case FTS_SL:
ftw_flag = FTW_SL;
break;
case FTS_NS:
ftw_flag = FTW_NS;
break;
/* Values that should only occur in nftw mode */
case FTS_SLNONE:
if (MODE_NFTW == mode) {
ftw_flag = FTW_SLN;
} else {
ftw_flag = FTW_SL;
}
break;
case FTS_DP:
if ((MODE_NFTW == mode) && (flags & FTW_DEPTH)) {
ftw_flag = FTW_D;
} else {
skip_entry = 1;
}
break;
default:
/* I'm not sure this is right, but we don't have a valid FTW
* type to call with, so cowardice seems the better part of
* guessing.
*/
skip_entry = 1;
}
if (MODE_FTW == mode) {
ftw_func = (__ftw_func_t) func;
func_ret = (*ftw_func)
(path_name.c_str(), entry->fts_statp, ftw_flag);
} else if (MODE_NFTW == mode) {
ftw_st.base = (entry->fts_pathlen - entry->fts_namelen);
ftw_st.level = entry->fts_level;
nftw_func = (__nftw_func_t) func;
func_ret = (*nftw_func)
(path_name.c_str(), entry->fts_statp, ftw_flag, &ftw_st);
}
if (0 != func_ret) {
return func_ret;
}
}
if (0 != errno) { /* fts_read returned NULL, and set errno - bail */
return -1;
}
/* The janitors will be upset if we don't clean up after ourselves. */
if (0 != fts_close(hierarchy)) {
return -1;
}
return 0;
}

View File

@ -1,106 +0,0 @@
/*
Copyright (c) 2003 by Joel Baker.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Author nor the names of any contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#ifndef _FTW_H
#define _FTW_H
#include <sys/stat.h>
/* Enumerated values for 'flag' when calling [n]ftw */
enum {
FTW_D, /* Directories */
FTW_DNR, /* Unreadable directory */
FTW_F, /* Regular files */
FTW_SL, /* Symbolic link */
FTW_NS, /* stat(2) failed */
#ifdef __USE_XOPEN_EXTENDED /* X/Open */
/* Flags for nftw only */
FTW_DP, /* Directory, subdirs visited */
FTW_SLN, /* Dangling symlink */
#endif /* __USE_XOPEN_EXTENDED */
};
#ifdef __USE_XOPEN_EXTENDED /* X/Open */
/* Enumerated values for 'flags' when calling nftw */
enum {
FTW_CHDIR = 1, /* Do a chdir(2) when entering a directory */
FTW_DEPTH = 2, /* Report files first (before directory) */
FTW_MOUNT = 4, /* Single filesystem */
FTW_PHYS = 8 /* Physical walk; ignore symlinks */
};
#define FTW_PHYS FTW_PHYS
#define FTW_MOUNT FTW_MOUNT
#define FTW_CHDIR FTW_CHDIR
#define FTW_DEPTH FTW_DEPTH
/* FTW struct for callbacks from nftw */
struct FTW {
int base;
int level;
};
#endif /* __USE_XOPEN_EXTENDED */
/* Typecasts for callback functions */
typedef int (*__ftw_func_t) \
(const char *file, const struct stat *status, int flag);
#ifdef __USE_XOPEN_EXTENDED /* X/Open */
typedef int (*__nftw_func_t) \
(const char *file, const struct stat *status, int flag, struct FTW *detail);
#endif /* __USE_XOPEN_EXTENDED */
/* ftw: walk a directory tree, calling a function for each element */
extern int ftw (const char *dir, __ftw_func_t func, int descr);
#ifdef __USE_XOPEN_EXTENDED /* X/Open */
/* nftw: walk a directory tree, calling a function for each element; much
* like ftw, but with behavior flags and minty freshness.
*/
extern int nftw (const char *dir, __nftw_func_t func, int descr, int flags);
#endif /* __USE_XOPEN_EXTENDED */
#endif /* _FTW_H */

View File

@ -1,20 +0,0 @@
#ifndef __irix_platform__
#define __irix_platform__
#include <pbd/platform.h>
class IrixPlatform : public Platform {
public:
IrixPlatform () : Platform () {};
virtual ~IrixPlatform ();
virtual int pre_config ();
virtual int post_config ();
virtual int pre_ui ();
virtual int post_ui ();
virtual int dsp_startup();
};
#endif // __irix_platform__

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 1999 Paul Barton-Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/
#ifndef __linux_platform_h__
#define __linux_platform_h__
#include <pbd/platform.h>
class LinuxPlatform : public Platform
{
public:
LinuxPlatform ();
~LinuxPlatform () {};
int pre_config ();
int post_config ();
int pre_ui ();
int post_ui ();
int dsp_startup() { return 0; }
};
#endif // __linux_platform_h__

View File

@ -1,45 +0,0 @@
/*
Copyright (C) 1999 Paul Barton-Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/
#ifndef __qm_platform_h__
#define __qm_platform_h__
class Platform
{
public:
Platform () {
thePlatform = this;
}
virtual ~Platform () {}
virtual int pre_config () { return 0;}
virtual int post_config () { return 0;}
virtual int pre_ui () { return 0; }
virtual int post_ui () { return 0; }
virtual int dsp_startup() { return 0; }
static Platform *instance() { return thePlatform; }
private:
static Platform *thePlatform;
};
#endif // __qm_platform_h__

View File

@ -1,12 +0,0 @@
#ifndef __platform_factory__
#define __platform_factory__
#include <pbd/platform.h>
class PlatformFactory {
public:
static Platform* create_platform ();
};
#endif // __platform_factory__

View File

@ -1,41 +0,0 @@
/*
Copyright (C) 1999 Paul Barton-Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/
#ifndef __solaris_platform_h__
#define __solaris_platform_h__
#include <pbd/platform.h>
class SolarisPlatform : public Platform
{
public:
SolarisPlatform () : Platform () {};
~SolarisPlatform () {};
int pre_config ();
int post_config ();
int pre_ui ();
int post_ui ();
int dsp_startup() { return 0; }
};
#endif // __solaris_platform_h__

View File

@ -1,25 +0,0 @@
/*
Copyright (C) 1998-99 Paul Barton-Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/
#ifndef __libmisc_strsub_h__
#define __libmisc_strsub_h__
extern char *strsub (char *str, const char *target, const char *replacement);
#endif // __libmisc_strsub_h__

View File

@ -0,0 +1,8 @@
#ifndef __pbd_whitespace_h__
#define __pbd_whitespace_h__
#include <string>
extern void strip_whitespace_edges (std::string& str);
#endif // __pbd_whitespace_h__

30
libs/pbd3/whitespace.cc Normal file
View File

@ -0,0 +1,30 @@
#include <pbd/whitespace.h>
using namespace std;
void
strip_whitespace_edges (string& str)
{
string::size_type i;
string::size_type len;
string::size_type s;
len = str.length();
for (i = 0; i < len; ++i) {
if (isgraph (str[i])) {
break;
}
}
s = i;
for (i = len - 1; i >= 0; --i) {
if (isgraph (str[i])) {
break;
}
}
str = str.substr (s, (i - s) + 1);
}