X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FFile.cpp;h=4df3274eb86c3f77fa3280abb49303bbee9da9f0;hb=cc0ca971057edb5e4c8f78946b0c5508395ecc48;hp=379efe62eb0c650c5d06b82650635594240f4e1d;hpb=ec3c8f790fc7e8d870d518211e124830c4bdf1d3;p=folly.git diff --git a/folly/File.cpp b/folly/File.cpp index 379efe62..4df3274e 100644 --- a/folly/File.cpp +++ b/folly/File.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2015 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +16,14 @@ #include -#include -#include #include #include #include #include +#include +#include +#include #include @@ -52,6 +53,12 @@ File::File(const char* name, int flags, mode_t mode) ownsFd_ = true; } +File::File(const std::string& name, int flags, mode_t mode) + : File(name.c_str(), flags, mode) {} + +File::File(StringPiece name, int flags, mode_t mode) + : File(name.str(), flags, mode) {} + File::File(File&& other) noexcept : fd_(other.fd_) , ownsFd_(other.ownsFd_) {