/** @file MOMDiscInfo.cpp
 *
 * Copyright (C) Espial Limited 2014 - Company confidential - All rights reserved.
 *
 */

#include "config.h"

#if ENABLE(RMAI)

#include "MOMDiscInfo.h"

extern "C" {
#include "layers.h"
#include "cdf/mom_discinfo.h"
}

namespace WebCore {

PassRefPtr<MOMDiscInfo> MOMDiscInfo::create(mom_recorder recorder)
{
    return adoptRef(new MOMDiscInfo(recorder));
}

MOMDiscInfo::MOMDiscInfo(mom_recorder recorder)
    : m_recorder(recorder)
{
    mom_discinfo_create(recorder);
}

MOMDiscInfo::~MOMDiscInfo()
{
    mom_discinfo_dispose(mom_recorder_get_discinfo(m_recorder));
}

int MOMDiscInfo::state() const
{
    return mom_discinfo_get_disc_state(mom_recorder_get_discinfo(m_recorder));
}

int MOMDiscInfo::free() const
{
    return mom_discinfo_get_free_space(mom_recorder_get_discinfo(m_recorder));
}

int MOMDiscInfo::total() const
{
    return mom_discinfo_get_total_space(mom_recorder_get_discinfo(m_recorder));
}

} // namespace WebCore

#endif // ENABLE(RMAI)
