summaryrefslogtreecommitdiffstats
path: root/contrib/python/pythran/pythran/pythonic/builtins/file/truncate.hpp
blob: ad605e2477e9d65e6c19ea5d44cbbe317a075191 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef PYTHONIC_BUILTIN_FILE_TRUNCATE_HPP
#define PYTHONIC_BUILTIN_FILE_TRUNCATE_HPP

#include "pythonic/include/builtins/file/truncate.hpp"

#include "pythonic/types/file.hpp"
#include "pythonic/utils/functor.hpp"

PYTHONIC_NS_BEGIN

namespace builtins
{

  namespace file
  {

    inline void truncate(types::file &f)
    {
      f.truncate();
    }

    inline void truncate(types::file &&f)
    {
      f.truncate();
    }

    inline void truncate(types::file &f, long size)
    {
      f.truncate(size);
    }

    inline void truncate(types::file &&f, long size)
    {
      f.truncate(size);
    }
  } // namespace file
} // namespace builtins
PYTHONIC_NS_END
#endif