DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
retired_flags.cc
1 // Copyright 2017 Google Inc. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 //
7 // Defines retired / deprecated flags. These flags will be removed in later
8 // versions.
9 
10 #include "packager/app/retired_flags.h"
11 
12 #include <stdio.h>
13 
14 DEFINE_string(profile, "", "This flag is deprecated. Do not use.");
15 DEFINE_bool(single_segment, true, "This flag is deprecated. Do not use.");
16 
17 // The current gflags library does not provide a way to check whether a flag is
18 // set in command line. If a flag has a different value to its default value,
19 // the flag must have been set. It is possible that the flag is set to the same
20 // value as its default value though.
21 bool InformRetiredStringFlag(const char* flagname, const std::string& value) {
22  if (!value.empty())
23  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
24  return true;
25 }
26 
27 bool InformRetiredDefaultTrueFlag(const char* flagname, bool value) {
28  if (!value)
29  fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
30  return true;
31 }
32 
33 DEFINE_validator(profile, &InformRetiredStringFlag);
34 DEFINE_validator(single_segment, &InformRetiredDefaultTrueFlag);