#define _CLOCK_COMMON_BINARY_FILE_READER_H_
#include "Utils/Reader.h"
-#include "Utils/TizenAppUtils.h"
#include <vector>
namespace utils {
public:
/**
* @brief Constructs object instance
- * @param dir the application accessible directory
* @param filename file name.
*/
- BinaryFileReader(TizenAppUtils::AppSubdirectory dir, const char *filename);
+ BinaryFileReader(const char *filename);
~BinaryFileReader() {}
void Read(void *buffer, size_t size);
private:
#define _CLOCK_COMMON_BINARY_FILE_WRITER_H_
#include "Utils/Writer.h"
-#include "Utils/TizenAppUtils.h"
#include <fstream>
* @param dir the application accessible directory
* @param filename file name.
*/
- BinaryFileWriter(TizenAppUtils::AppSubdirectory dir, const char *filename);
+ BinaryFileWriter(const char *filename);
~BinaryFileWriter();
void Write(const void *buffer, size_t size);
/**
AlarmProvider::AlarmProvider()
{
- BinaryFileReader reader(TizenAppUtils::APP_DIR_DATA, DATABASE_FILE);
+ BinaryFileReader reader(TizenAppUtils::GetResourcePath(TizenAppUtils::APP_DIR_DATA, DATABASE_FILE));
impl_ = new AlarmBinaryStorage(reader);
if (HasActiveAlarms())
Notifier::GetInstance().AlarmNotiPost();
void AlarmProvider::Sync()
{
- BinaryFileWriter writer(TizenAppUtils::APP_DIR_DATA, DATABASE_FILE);
+ BinaryFileWriter writer(TizenAppUtils::GetResourcePath(TizenAppUtils::APP_DIR_DATA, DATABASE_FILE));
impl_->Serialize(writer);
writer.Flush();
using namespace utils;
using namespace std;
-BinaryFileReader::BinaryFileReader(TizenAppUtils::AppSubdirectory dir, const char *filename)
+BinaryFileReader::BinaryFileReader(const char *filename)
{
- ifstream file(TizenAppUtils::GetResourcePath(dir, filename));
+ ifstream file(filename);
offset = 0;
if (!file.good()) {
using namespace utils;
using namespace std;
-BinaryFileWriter::BinaryFileWriter(TizenAppUtils::AppSubdirectory dir, const char *filename) :
- file(TizenAppUtils::GetResourcePath(dir, filename), ios::binary)
+BinaryFileWriter::BinaryFileWriter(const char *filename) :
+ file(filename, ios::binary)
{
if (!file.good())
abort();