summaryrefslogtreecommitdiffstats
path: root/chrome/common/media_galleries/pmp_test_util.h
blob: d3f5d3a6360e8890b254890746ff4553acafbe57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_MEDIA_GALLERIES_PMP_TEST_UTIL_H_
#define CHROME_COMMON_MEDIA_GALLERIES_PMP_TEST_UTIL_H_

#include <string>
#include <vector>

#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "chrome/common/media_galleries/pmp_constants.h"

namespace picasa {

namespace PmpTestUtil {

bool WriteIndicatorFile(
    const base::FilePath& column_file_destination,
    const std::string& table_name);

template<class T>
bool WriteColumnFileFromVector(
    const base::FilePath& column_file_destination,
    const std::string& table_name,
    const std::string& column_name,
    const PmpFieldType field_type,
    const std::vector<T>& elements_vector);

std::vector<char> MakeHeader(const PmpFieldType field_type,
                             const uint32 row_count);

template<class T>
std::vector<char> MakeHeaderAndBody(const PmpFieldType field_type,
                                    const uint32 row_count,
                                    const std::vector<T>& elems);

}  // namespace PmpTestUtil

}  // namespace picasa

#endif  // CHROME_COMMON_MEDIA_GALLERIES_PMP_TEST_UTIL_H_