summaryrefslogtreecommitdiffstats
path: root/buildtools/autotools/misc.h
blob: 26bb0e832f30efa5b8776fa94405619e7cf22887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/***************************************************************************
*   Copyright (C) 2001-2002 by Bernd Gehrmann                             *
*   bernd@kdevelop.org                                                    *
*                                                                         *
*   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.                                   *
*                                                                         *
***************************************************************************/

#ifndef _MISC_H_
#define _MISC_H_

#include <tqcstring.h>
#include <tqmap.h>
#include <tqwidget.h>

/**
 * Very small helper class. It has just static methods.
 */
class AutoProjectTool
{
public:

	/**
	 * Loads the compiler options plugin for the given compiler, executes the dialog
	 * with some initial flags, and returns the new flags.
	 */
	static TQString execFlagsDialog( const TQString &compiler, const TQString &flags, TQWidget *tqparent );

	/**
	 * Returns the canonicalized version of a file name, i.e.
	 * the file name with special characters replaced by underscores
	 */
	static TQString canonicalize( const TQString &str );

	/**
	 * Parses a Makefile.am and stores its variable assignments
	 * in a map.
	 */
	static void parseMakefileam( const TQString &filename, TQMap<TQString, TQString> *variables );

	static void addToMakefileam( const TQString &filename, TQMap<TQString, TQString> variables );
	static void removeFromMakefileam( const TQString &filename, TQMap<TQString, TQString> variables );
	static void setMakefileam ( const TQString &fileName, TQMap<TQString, TQString> variables );

	static void addRemoveMakefileam(const TQString &fileName, TQMap<TQString, TQString> variables,  bool add);

	/**
	 * Parses configure.in and splits AC_OUTPUT into a TQStringList
	 */
	static TQStringList configureinLoadMakefiles( TQString configureinpath );

	/**
	 * Receives a TQStringList and puts it into
	 * configure.in as arguments to AC_OUTPUT
	 */
	static void configureinSaveMakefiles( TQString configureinpath, TQStringList makefiles );

};

#endif
// kate: indent-mode csands; tab-width 4;