1 // Copyright (c) 2012 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. 4 5 #ifndef CHROME_COMMON_MAC_NSCODER_UTIL_H_ 6 #define CHROME_COMMON_MAC_NSCODER_UTIL_H_ 7 8 #import <Foundation/Foundation.h> 9 10 #include <string> 11 12 namespace nscoder_util { 13 14 // Archives a std::string in an Objective-C key archiver. 15 void EncodeString(NSCoder* coder, NSString* key, const std::string& string); 16 17 // Decode a std::string from an Objective-C key unarchiver. 18 std::string DecodeString(NSCoder* decoder, NSString* key); 19 20 } // namespace nscoder_util 21 22 #endif // CHROME_COMMON_MAC_NSCODER_UTIL_H_ 23