Fix SimpleBarrier
[folly.git] / folly / File.h
index cf8fdc7f71167b464ef5455e56370189a99efb67..26d158e11f9b1fb5dca80ce228f24211077ad05e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  */
 
-#ifndef FOLLY_FILE_H_
-#define FOLLY_FILE_H_
+#pragma once
 
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
+
+#include <string>
 
 #include <folly/Portability.h>
+#include <folly/Range.h>
+#include <folly/portability/Unistd.h>
 
 namespace folly {
 
@@ -46,6 +48,9 @@ class File {
    * Open and create a file object.  Throws on error.
    */
   explicit File(const char* name, int flags = O_RDONLY, mode_t mode = 0666);
+  explicit File(
+      const std::string& name, int flags = O_RDONLY, mode_t mode = 0666);
+  explicit File(StringPiece name, int flags = O_RDONLY, mode_t mode = 0666);
 
   ~File();
 
@@ -130,5 +135,3 @@ void swap(File& a, File& b);
 
 
 }  // namespace folly
-
-#endif /* FOLLY_FILE_H_ */