openldev/openldev-utils.h File Reference

Utility Functions. More...

#include <gtksourceview/gtksourceview.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <iostream>
#include <fstream>

Functions

string openldev_add_prefix (string file)
void openldev_error (string message)
gboolean openldev_question (string message)
void openldev_write_file (string file, string text)
string openldev_read_file (string file)
gboolean openldev_is_error_or_warning (string output)
int openldev_get_file_name_and_line (string &output)
void openldev_add_new_stock_item (GtkIconFactory *icon_factory, gchar *name, gchar *id, gchar *file)


Detailed Description


Function Documentation

void openldev_add_new_stock_item GtkIconFactory *  icon_factory,
gchar *  name,
gchar *  id,
gchar *  file
 

Add a new stock menu item. These can be used in menus, toolbars or popup menus.

Parameters:
icon_factory The stock item is added to this GtkIconFactory.
name Text displayed beside the stock image.
id Access id that will be used when referencing the stock item.
file Full location of the image.

string openldev_add_prefix string  file  ) 
 

Add INSTALL_PREFIX to the beginning of the string. This is so the user can define custom install prefixes.

Parameters:
file File name that INSTALL_PREFIX should be added to.
Returns:
The full file name the prefix was attached to.

void openldev_error string  message  ) 
 

Give the user a message. There is no need to add newline characters because the message will wrap automatically. The message also supports Pango formatting.

Parameters:
message The text that should be shown in the dialog.

int openldev_get_file_name_and_line string &  output  ) 
 

Get the line number the error or warning is on and what file it is from.

Parameters:
output The build output string, which is converted just to the short file name.
Returns:
The line number where the error or warning occurred.

gboolean openldev_is_error_or_warning string  output  ) 
 

You can use this function to check whether the line of make output is an error or a warning.

Parameters:
output The build output string. This should only be one line long.
Returns:
TRUE if the build output line is an error or a warning.

gboolean openldev_question string  message  ) 
 

Ask the user a question, specified by your message. The user's choice is returned from the

Parameters:
message The question that is to be shown in the dialog.
Returns:
TRUE if the Yes button was pressed.

string openldev_read_file string  file  ) 
 

Read the contents of a file. This function uses GLib functions to verify that the file exists.

Parameters:
file Full location where the file is located.
Returns:
Text content of the file.

void openldev_write_file string  file,
string  text
 

Write text to a file. This uses the standard C++ ofstream functions.

Parameters:
file Full location where the file is located.
text Text that should be written to the file.


Generated on Mon Apr 24 21:35:34 2006 for OpenLDev by  doxygen 1.4.6