xbmc
Stat.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "AddonClass.h"
12 #include "LanguageHook.h"
13 #include "filesystem/File.h"
14 
15 namespace XBMCAddon
16 {
17  namespace xbmcvfs
18  {
19  //
43  //
44  class Stat : public AddonClass
45  {
46  struct __stat64 st;
47 
48  public:
49  Stat(const String& path)
50  {
52  XFILE::CFile::Stat(path, &st);
53  }
54 
55 #ifdef DOXYGEN_SHOULD_USE_THIS
56  st_mode();
64 #else
65  inline long long st_mode() { return st.st_mode; }
66 #endif
67 
68 #ifdef DOXYGEN_SHOULD_USE_THIS
69  st_ino();
77 #else
78  inline long long st_ino() { return st.st_ino; }
79 #endif
80 
81 #ifdef DOXYGEN_SHOULD_USE_THIS
82  st_dev();
92 #else
93  inline long long st_dev() { return st.st_dev; }
94 #endif
95 
96 #ifdef DOXYGEN_SHOULD_USE_THIS
97  st_nlink();
105 #else
106  inline long long st_nlink() { return st.st_nlink; }
107 #endif
108 
109 #ifdef DOXYGEN_SHOULD_USE_THIS
110  st_uid();
118 #else
119  inline long long st_uid() { return st.st_uid; }
120 #endif
121 
122 #ifdef DOXYGEN_SHOULD_USE_THIS
123  st_gid();
131 #else
132  inline long long st_gid() { return st.st_gid; }
133 #endif
134 
135 #ifdef DOXYGEN_SHOULD_USE_THIS
136  st_size();
149 #else
150  inline long long st_size() { return st.st_size; }
151 #endif
152 
153 #ifdef DOXYGEN_SHOULD_USE_THIS
154  st_atime();
162 #else
163  inline long long atime() { return st.st_atime; }; //names st_atime/st_mtime/st_ctime are used by sys/stat.h
164 #endif
165 
166 #ifdef DOXYGEN_SHOULD_USE_THIS
167  st_mtime();
175 #else
176  inline long long mtime() { return st.st_mtime; }
177 #endif
178 
179 #ifdef DOXYGEN_SHOULD_USE_THIS
180  st_ctime();
188 #else
189  inline long long ctime() { return st.st_ctime; }
190 #endif
191  };
193  }
194 }
195 
static int Stat(const CURL &file, struct __stat64 *buffer)
Fills struct __stat64 with information about file specified by filename For st_mode function will set...
Definition: File.cpp:517
Definition: Stat.h:44
Defining LOG_LIFECYCLE_EVENTS will log all instantiations, deletions and also reference countings (in...
Definition: Addon.cpp:25
This class can be used to access the language hook's DelayedCallOpen and DelayedCallClose.
Definition: LanguageHook.h:122
This class is the superclass for all reference counted classes in the api.
Definition: AddonClass.h:57