Bimo
Bimo

Reputation: 6617

how do you convert a relative path to an absolute path under C++/ gtkmm?

how do you convert a relative path to an absolute path under C++ and gtk?

Upvotes: 2

Views: 429

Answers (1)

Bimo
Bimo

Reputation: 6617

// For C++ with Gnome Gtkmm3 libraries
#include <string>
#include <glibmm.h>
#include <giomm.h>

using namespace std;

string PathRel2Abs(string relpath) {
  Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(relpath);
  return file->get_path();
}

Upvotes: 1

Related Questions