1 /*$Id: l_lib.h,v 26.81 2008/05/27 05:34:00 al Exp $ -*- C++ -*-
2 * Copyright (C) 2001 Albert Davis
3 * Author: Albert Davis <aldavis@gnu.org>
5 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 //testing=script 2006.07.13
26 /*--------------------------------------------------------------------------*/
28 INTERFACE
bool Umatch(const std::string
&, const std::string
&);
29 INTERFACE
bool wmatch(const std::string
& s1
,const std::string
& s2
);
30 INTERFACE
std::string
to_string(unsigned);
31 INTERFACE
std::string
to_string(int);
32 INTERFACE
std::string
to_string(double);
33 INTERFACE
char* ftos(double,int,int,int);
34 /*--------------------------------------------------------------------------*/
36 enum { /* formatting bit-fields */
37 ftos_DEFAULT
= 0, /* default formatting, with letters */
38 ftos_EXP
= 1, /* use 'e' notation, almost like printf */
39 ftos_SIGN
= 2, /* always include sign */
40 ftos_FILL
= 4 /* fill in trailing zeros */
42 /*--------------------------------------------------------------------------*/
43 // wrappers for old standard C lpbrary
45 inline void system(const std::string
& s
) {itested();
49 inline void chdir(const std::string
& s
) {itested();
53 inline void remove(const std::string
& s
) {itested();
57 inline bool access_ok(const std::string
& file
, int mode
) {
58 return (::access(file
.c_str(), mode
) == 0/*file_ok*/);
61 inline std::string
getcwd() {itested();
63 char* cwd
= ::getcwd(buf
,BUFLEN
);
71 inline std::string
getenv(const std::string
& s
) {
72 char* ev
= ::getenv(s
.c_str());
80 /*--------------------------------------------------------------------------*/
81 /*--------------------------------------------------------------------------*/
83 // vim:ts=8:sw=2:noet: