dingui

[Archived] Graphical interface for Dingux (linux running on Dingoo A320)
git clone https://git.neuralcrash.com/dingui.git
Log | Files | Refs | README | LICENSE

Element.cpp (601B)


      1 #include "Element.hpp"
      2 
      3 Element::Element(dirent * uneEntree)
      4 :sonNom(uneEntree->d_name)
      5 ,sonExtension("")
      6 ,sonType(inconnu)
      7 {
      8 
      9 	switch (uneEntree->d_type)
     10 	{
     11 		case DT_DIR :
     12 			sonType = dossier;
     13 			break;
     14 		case DT_REG :
     15 			sonType = fichier;
     16 			break;
     17 		default :
     18 			sonType = inconnu;
     19 	}
     20 
     21 	if (sonType == fichier)
     22 	{
     23 		int lePoint = sonNom.find_last_of('.');
     24 		sonExtension = sonNom.substr(lePoint + 1);
     25 	}
     26 
     27 }
     28 
     29 std::string Element::getSonNom() const
     30 {
     31 	return sonNom;
     32 }
     33 
     34 std::string Element::getSonExtension() const
     35 {
     36 	return sonExtension;
     37 }
     38 
     39 type Element::getSonType() const
     40 {
     41 	return sonType;
     42 }
     43