Skip to content

Commit

Permalink
move code and docs into subdirectories, rename .h to .hh
Browse files Browse the repository at this point in the history
  • Loading branch information
i-rinat committed Oct 4, 2014
1 parent bff3f00 commit 1973662
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 76 deletions.
78 changes: 34 additions & 44 deletions CMakeLists.txt
@@ -1,67 +1,57 @@
project (fragview)
cmake_minimum_required (VERSION 2.6)
set (CMAKE_C_FLAGS_DEBUG "-ggdb3 -O0")
set (CMAKE_CXX_FLAGS_DEBUG "-ggdb3 -O0")
set (CMAKE_C_FLAGS_RELEASE "-O3")
set (CMAKE_CXX_FLAGS_RELEASE "-O3")
if(NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release)
endif()
project(fragview)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_C_FLAGS_DEBUG "-ggdb3 -O0")
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb3 -O0")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

find_package (PkgConfig REQUIRED)
find_package (Boost REQUIRED)

pkg_check_modules (GTKMM REQUIRED gtkmm-3.0)
pkg_check_modules (GLIBMM REQUIRED glibmm-2.4)
pkg_check_modules (SQLITE3 REQUIRED sqlite3)
pkg_check_modules(REQ REQUIRED gtkmm-3.0 glibmm-2.4 sqlite3)

link_directories (
${GTKMM_LIBRARY_DIRS}
${SQLITE3_LIBRARY_DIRS}
)
link_directories(${REQ_LIBRARY_DIRS})

include_directories (
${GTKMM_INCLUDE_DIRS}
${SQLITE3_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
include_directories(
${REQ_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)

add_library (clusters STATIC
clusters.cc
util.cc
add_library(clusters STATIC
src/clusters.cc
src/util.cc
)

add_executable (fragview
fragview.cc
fragmap-widget.cc
filelist-widget.cc
mountpoint-select-dialog.cc
add_executable(fragview
src/fragview.cc
src/fragmap-widget.cc
src/filelist-widget.cc
src/mountpoint-select-dialog.cc
)

add_executable (fileseverity
fileseverity.cc
add_executable(fileseverity
src/fileseverity.cc
)

target_link_libraries (fragview
clusters
${GTKMM_LIBRARIES}
target_link_libraries(fragview
clusters
${REQ_LIBRARIES}
)

target_link_libraries (fileseverity
clusters
${GLIBMM_LIBRARIES}
target_link_libraries(fileseverity
clusters
${REQ_LIBRARIES}
)

add_executable (fragdb
fragdb.cc
add_executable(fragdb
src/fragdb.cc
)

target_link_libraries (fragdb
clusters
${GLIBMM_LIBRARIES}
${SQLITE3_LIBRARIES}
target_link_libraries(fragdb
clusters
${REQ_LIBRARIES}
)

install (TARGETS fileseverity fragdb fragview
RUNTIME DESTINATION "bin"
install(TARGETS fileseverity fragdb fragview
RUNTIME DESTINATION "bin"
)
File renamed without changes.
2 changes: 1 addition & 1 deletion clusters.cc → src/clusters.cc
@@ -1,4 +1,4 @@
#include "clusters.h"
#include "clusters.hh"
#include <map>
#include <iostream>
#include <fstream>
Expand Down
6 changes: 3 additions & 3 deletions clusters.h → src/clusters.hh
@@ -1,5 +1,5 @@
#ifndef __CLUSTERS_H__
#define __CLUSTERS_H__
#ifndef FRAGVIEW_CLUSTERS_HH
#define FRAGVIEW_CLUSTERS_HH

#include <stdint.h>
#include <vector>
Expand Down Expand Up @@ -102,4 +102,4 @@ class Clusters {
unsigned int coarse_map_granularity;
};

#endif
#endif // FRAGVIEW_CLUSTERS_HH
6 changes: 3 additions & 3 deletions filelist-widget.cc → src/filelist-widget.cc
@@ -1,9 +1,9 @@
#include "filelist-widget.h"
#include <iostream>
#include <iomanip>
#include <cassert>
#include "fragmap-widget.h"
#include "util.h"
#include "filelist-widget.hh"
#include "fragmap-widget.hh"
#include "util.hh"

FilelistView::FilelistView()
{
Expand Down
8 changes: 4 additions & 4 deletions filelist-widget.h → src/filelist-widget.hh
@@ -1,12 +1,12 @@
#pragma once
#ifndef __FILELIST_WIDGET_H__
#define __FILELIST_WIDGET_H__
#ifndef FRAGVIEW_FILELIST_WIDGET_HH
#define FRAGVIEW_FILELIST_WIDGET_HH

#include <gtkmm/treeview.h>
#include <gtkmm/liststore.h>
#include <stdint.h>
#include <map>


class Fragmap;

class FilelistView : public Gtk::TreeView
Expand Down Expand Up @@ -58,4 +58,4 @@ class FilelistView : public Gtk::TreeView
void cell_data_func_size(Gtk::CellRenderer *cell, const Gtk::TreeModel::iterator &iter);
};

#endif
#endif // FRAGVIEW_FILELIST_WIDGET_HH
2 changes: 1 addition & 1 deletion fileseverity.cc → src/fileseverity.cc
Expand Up @@ -4,7 +4,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "clusters.h"
#include "clusters.hh"

void print_usage() {
printf("Usage: fileseverity [-k] file [file] [file] ...\n");
Expand Down
2 changes: 1 addition & 1 deletion fragdb.cc → src/fragdb.cc
Expand Up @@ -5,12 +5,12 @@
* list of most fragmented files from previous scan
*/

#include "clusters.h"
#include <sqlite3.h>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include "clusters.hh"

const char *sql_create_tables =
"DROP TABLE IF EXISTS items; "
Expand Down
3 changes: 2 additions & 1 deletion fragmap-widget.cc → src/fragmap-widget.cc
@@ -1,8 +1,9 @@
#include "fragmap-widget.h"
#include <iostream>
#include <assert.h>
#include <sys/time.h>
#include <gtkmm/box.h>
#include "fragmap-widget.hh"


Fragmap::Fragmap()
{
Expand Down
11 changes: 6 additions & 5 deletions fragmap-widget.h → src/fragmap-widget.hh
@@ -1,5 +1,5 @@
#ifndef FRAGVIEW_FRAGMAP_WIDGET_H
#define FRAGVIEW_FRAGMAP_WIDGET_H
#ifndef FRAGVIEW_FRAGMAP_WIDGET_HH
#define FRAGVIEW_FRAGMAP_WIDGET_HH

#include <gtkmm/drawingarea.h>
#include <gtkmm/widget.h>
Expand All @@ -9,8 +9,9 @@
#include <gtkmm/box.h>
#include <stdint.h>
#include <pthread.h>
#include "clusters.h"
#include "filelist-widget.h"
#include "clusters.hh"
#include "filelist-widget.hh"


class Fragmap : public Gtk::HBox {
public:
Expand Down Expand Up @@ -81,4 +82,4 @@ class Fragmap : public Gtk::HBox {
void cairo_set_source_rgbv(const Cairo::RefPtr<Cairo::Context> &cr, double const color[]);
};

#endif // FRAGVIEW_FRAGMAP_WIDGET_H
#endif // FRAGVIEW_FRAGMAP_WIDGET_HH
8 changes: 4 additions & 4 deletions fragview.cc → src/fragview.cc
Expand Up @@ -9,14 +9,14 @@
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/statusbar.h>
#include <gtkmm/stock.h>
#include "clusters.h"
#include "fragmap-widget.h"
#include "filelist-widget.h"
#include "mountpoint-select-dialog.h"
#include <iostream>
#include <locale>
#include <pwd.h>
#include <cassert>
#include "clusters.hh"
#include "fragmap-widget.hh"
#include "filelist-widget.hh"
#include "mountpoint-select-dialog.hh"

class GraphWindow : public Gtk::Window {
public:
Expand Down
@@ -1,4 +1,3 @@
#include "mountpoint-select-dialog.h"
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/stock.h>
Expand All @@ -7,7 +6,9 @@
#include <iostream>
#include <fstream>
#include <sys/vfs.h>
#include "util.h"
#include "util.hh"
#include "mountpoint-select-dialog.hh"


MountpointSelectDialog::MountpointSelectDialog(void)
{
Expand Down
@@ -1,5 +1,5 @@
#ifndef FRAGVIEW_MOUNTPOINT_SELECT_DIALOG_H
#define FRAGVIEW_MOUNTPOINT_SELECT_DIALOG_H
#ifndef FRAGVIEW_MOUNTPOINT_SELECT_DIALOG_HH
#define FRAGVIEW_MOUNTPOINT_SELECT_DIALOG_HH

#include <gtkmm/dialog.h>
#include <gtkmm/treeview.h>
Expand Down Expand Up @@ -46,4 +46,4 @@ class MountpointSelectDialog : public Gtk::Dialog
Gtk::TreeModelColumn<uint64_t> *column);
};

#endif // FRAGVIEW_MOUNTPOINT_SELECT_DIALOG_H
#endif // FRAGVIEW_MOUNTPOINT_SELECT_DIALOG_HH
2 changes: 1 addition & 1 deletion util.cc → src/util.cc
@@ -1,7 +1,7 @@
#define __STDC_LIMIT_MACROS
#include "util.h"
#include <sstream>
#include <iomanip>
#include "util.hh"

void
Util::format_filesize(uint64_t size, std::string &res)
Expand Down
6 changes: 3 additions & 3 deletions util.h → src/util.hh
@@ -1,5 +1,5 @@
#ifndef FRAGVIEW_UTIL_H
#define FRAGVIEW_UTIL_H
#ifndef FRAGVIEW_UTIL_HH
#define FRAGVIEW_UTIL_HH

#include <string>
#include <stdint.h>
Expand All @@ -11,4 +11,4 @@ class Util {
Util() {}
};

#endif // FRAGVIEW_UTIL_H
#endif // FRAGVIEW_UTIL_HH

0 comments on commit 1973662

Please sign in to comment.