converter.h

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 2003 Kristan Temme
00006  *
00007  * Authors: Kristan Temme <etptt@users.sf.net>
00008  *                                                                                
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 
00028 #include <gtk/gtk.h>
00029 
00030 #define MAX_PATH 1024 // maximum path-length
00031 #define EXT_SEP '.'     //Suffix seperator
00032 
00033 class converterData {
00034 
00035 public:
00036           converterData(gchar *src, gchar *dst, gchar *conv, gchar *write);
00037          ~converterData();      
00038 
00039     gchar *sourceDir;
00040         gchar *destDir;
00041         gchar *convFilter;
00042     gchar *writeFormat;
00043         bool m_recursive;
00044         bool m_overwrite_target;
00045         bool m_create_subdirs;
00046 };
00047 
00048 
00049 class converter {
00050 
00051 public:
00052         converter();
00053         ~converter();
00054    
00057   void ConvertDir(converterData *work_it, const gchar* current_dir);
00058   void DoConvert(gchar *pathname,gchar *outputname);    
00059   gint  readToAct(gchar *fname);  
00060   gint  writeFromCh(gint Ch, gchar *fname);     
00061   
00062         
00063 private:
00064         int m_converted;
00065         
00066         gchar*strParse(gchar *fname, converterData *check);
00067         gchar retStr[MAX_PATH];
00070         static void concatenate_dirs(gchar* target, const gchar* add);
00074         static void create_full_path(gchar* target,
00075                 const gchar* source_directory, const gchar* current_dir,
00076                 const gchar* file); 
00077         static void replace_suffix(gchar* target, gchar* new_suffix);
00078 };
00079 
00080 class converterControl : public DlgBase{        
00081 public:
00082 
00083     converterControl();
00084    ~converterControl();
00085 
00086         void run();
00087         static void dlg_clicked(GnomeDialog * dialog, gint button_number, converterControl *mic);
00088         static void recursive_click(GtkWidget* dialog, gpointer userdata);
00089         static void create_subdirs_click(GtkWidget* dialog, gpointer userdata);
00090         static void overwrite_target_click(GtkWidget* dialog, gpointer userdata);
00091   
00092         converterData *topdata;
00093         GtkWidget *SrcDir, *SrcMask, *DestDir, *DestMask;
00094 };

Generated on Sat Apr 1 09:04:24 2006 for GXSM by  doxygen 1.4.6