ソースを参照

libobs/util: Add ConfigFile::Swap function

Allows swapping the internal data of two ConfigFile objects.
jp9000 10 年 前
コミット
625ecda3dc
1 ファイル変更7 行追加0 行削除
  1. 7 0
      libobs/util/util.hpp

+ 7 - 0
libobs/util/util.hpp

@@ -72,6 +72,13 @@ public:
 		return config != NULL;
 		return config != NULL;
 	}
 	}
 
 
+	inline void Swap(ConfigFile &other)
+	{
+		config_t *newConfig = other.config;
+		other.config = config;
+		config = newConfig;
+	}
+
 	inline int Open(const char *file, config_open_type openType)
 	inline int Open(const char *file, config_open_type openType)
 	{
 	{
 		Close();
 		Close();