QTrk
Public Member Functions | Public Attributes | List of all members
PathSeperator Struct Reference

#include <utils.h>

Public Member Functions

 PathSeperator (std::string fullpath)
 

Public Attributes

std::string filename
 
std::string extension
 
std::string directory
 

Detailed Description

Definition at line 178 of file utils.h.

Constructor & Destructor Documentation

§ PathSeperator()

PathSeperator::PathSeperator ( std::string  fullpath)

Definition at line 70 of file utils.cpp.

71 {
72  int filenameEnd = fullpath.size();
73  int filenameStart = 0;
74  for (int i = fullpath.size()-1; i>=0; i--) {
75  if (fullpath[i] == '.' && extension.empty()) {
76  extension = fullpath.substr(i+1);
77  filenameEnd = i;
78  }
79  if (fullpath[i] == '/' || fullpath[i] == '\\') {
80  directory = fullpath.substr(0,i+1);
81  filenameStart = i+1;
82  break;
83  }
84  }
85  filename = fullpath.substr(filenameStart, filenameEnd - filenameStart);
86 }
std::string filename
Definition: utils.h:180
std::string directory
Definition: utils.h:180
std::string extension
Definition: utils.h:180

Member Data Documentation

§ directory

std::string PathSeperator::directory

Definition at line 180 of file utils.h.

§ extension

std::string PathSeperator::extension

Definition at line 180 of file utils.h.

§ filename

std::string PathSeperator::filename

Definition at line 180 of file utils.h.


The documentation for this struct was generated from the following files: