ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / native_client_sdk / src / libraries / nacl_io / getdents_helper.h
blob0d5d34f926cff3eb0b1b1b6fe7b3d4de214466b4
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef LIBRARIES_NACL_IO_GETDENTS_HELPER_H_
6 #define LIBRARIES_NACL_IO_GETDENTS_HELPER_H_
8 #include <vector>
10 #include "nacl_io/error.h"
11 #include "nacl_io/osdirent.h"
13 namespace nacl_io {
15 class GetDentsHelper {
16 public:
17 // Initialize the helper without any defaults.
18 GetDentsHelper();
19 GetDentsHelper(ino_t curdir_ino, ino_t parentdir_ino);
21 void Reset();
22 void AddDirent(ino_t ino, const char* name, size_t namelen);
23 Error GetDents(size_t offs, dirent* pdir, size_t size, int* out_bytes) const;
25 private:
26 void Initialize();
28 std::vector<dirent> dirents_;
29 ino_t curdir_ino_;
30 ino_t parentdir_ino_;
31 bool init_defaults_;
34 } // namespace nacl_io
36 #endif // LIBRARIES_NACL_IO_GETDENTS_HELPER_H_