Browse Source

TOOLS: Fix missing Apache license and bad merge.

pull/567/head
Philippe Liard 15 years ago
committed by Mihaela Rosca
parent
commit
5432e7bb6a
3 changed files with 43 additions and 1 deletions
  1. +5
    -0
      cpp/src/phonenumbers/default_logger.cc
  2. +23
    -0
      cpp/src/phonenumbers/default_logger.h
  3. +15
    -1
      tools/java/common/test/com/google/i18n/phonenumbers/tools/BuildMetadataFromXmlTest.java

+ 5
- 0
cpp/src/phonenumbers/default_logger.cc View File

@ -14,6 +14,9 @@
// Author: Philippe Liard
// This file should not be compiled when using Google base/.
#ifndef USE_GOOGLE_BASE
#include <iostream>
#include "phonenumbers/default_logger.h"
@ -47,3 +50,5 @@ void StdoutLogger::WriteLevel() {
} // namespace phonenumbers
} // namespace i18n
#endif // USE_GOOGLE_BASE

+ 23
- 0
cpp/src/phonenumbers/default_logger.h View File

@ -17,6 +17,28 @@
#ifndef I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
#define I18N_PHONENUMBERS_DEFAULT_LOGGER_H_
#ifdef USE_GOOGLE_BASE
namespace i18n {
namespace phonenumbers {
// If Google base/ is used, LOG() and VLOG() from base/logging.h are used
// therefore the default logger implementation (StdoutLogger) instantiated in
// phonenumberutil will actually never be used. Thus provide a dummy
// implementation of this logger.
class StdoutLogger : public Logger {
public:
virtual ~StdoutLogger() {}
virtual void WriteLevel() {}
virtual void WriteMessage(const string& /* msg */) {}
};
} // namespace phonenumbers
} // namespace i18n
#else
#include <string>
#include "phonenumbers/logger.h"
@ -103,4 +125,5 @@ class StdoutLogger : public Logger {
} // namespace phonenumbers
} // namespace i18n
#endif // USE_GOOGLE_BASE
#endif // I18N_PHONENUMBERS_DEFAULT_LOGGER_H_

+ 15
- 1
tools/java/common/test/com/google/i18n/phonenumbers/tools/BuildMetadataFromXmlTest.java View File

@ -1,4 +1,18 @@
// Copyright 2009 Google Inc. All Rights Reserved.
/*
* Copyright (C) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.i18n.phonenumbers.tools;


Loading…
Cancel
Save