#pragma once

#ifdef MSWINDOWS
	#include <windows.h>
#endif

class AL4_configuration
{
 public: 
 
    static std::vector<AL4_configuration*> All_configs;

    static int Create_new_configure(int Area, 
                std::string Path, std::string Name, bool Write, bool Create);
    static void Release_configure(int Handle);
    
    #ifdef MSWINDOWS 
    	HKEY create_key();
    	static void close_key(HKEY key);
    #else
    	int create_key();
    	static void close_key(int key);
    #endif
                
    std::string AppName;
    std::string KeyName;
    bool Read_only;
    bool Can_create;
    int Area_config;
    
    AL4_configuration(int Area, std::string Path,
        std::string Name, bool Write, bool Create);
    static std::string Value_string(int Handle, 
        std::string Name_value, std::string New_value, bool Set_new);
    static int Value_integer(int Handle, 
        std::string Name_value, int New_value, bool Set_new);
    static bool Value_boolean(int Handle, 
        std::string Name_value, bool New_value, bool Set_new);
    static std::string Binary_get(int Handle, std::string Name_value);
        
    static bool Value_present(int Handle, std::string Name_value);
    static void Value_delete(int Handle, std::string Name_value);
    static void Subkey_delete(int Handle, std::string Name_subkey);
    static void Values_list(int Handle, ArrayStr* List);
    static void Subkeys_list(int Handle, ArrayStr* List);
};
