class AdLint::Cc1::PrintfFormat::Ordinary

Public Class Methods

new(fmt) click to toggle source
# File lib/adlint/cc1/format.rb, line 250
def initialize(fmt)
  super(fmt, false)
end
scan(fmt_str) click to toggle source
# File lib/adlint/cc1/format.rb, line 234
def self.scan(fmt_str)
  # NOTE: The ISO C99 standard says;
  #
  # 7.19.6.1 The fprintf function
  #
  # 3 The format shall be a multibyte character sequence, beginning and
  #   ending in its initial shift state.  The format is composed of zero
  #   or more directives: ordinary multibyte characters (not %), which
  #   are copied unchanged to the output stream; and conversion
  #   specifiers, each of which results in fetching zero or more
  #   subsequent arguments, converting them, if applicable, according to
  #   the corresponding conversion specifier, and then writing the result
  #   to the output stream.
  fmt_str.slice!(/\A[^%]+/)
end

Public Instance Methods

acceptable?() click to toggle source

DESCRIPTION

Checks whether types of arguments match this directive.

RETURN VALUE

Boolean – True if types of arguments match this directive.

# File lib/adlint/cc1/format.rb, line 263
def acceptable?
  true
end
complete?() click to toggle source
# File lib/adlint/cc1/format.rb, line 277
def complete?
  true
end
conversion_specifier?() click to toggle source
# File lib/adlint/cc1/format.rb, line 254
def conversion_specifier?
  false
end
conversion_specifier_character() click to toggle source
# File lib/adlint/cc1/format.rb, line 329
def conversion_specifier_character
  nil
end
field_width() click to toggle source
# File lib/adlint/cc1/format.rb, line 317
def field_width
  nil
end
flags() click to toggle source
# File lib/adlint/cc1/format.rb, line 313
def flags
  nil
end
length_modifier() click to toggle source
# File lib/adlint/cc1/format.rb, line 325
def length_modifier
  nil
end
max_length() click to toggle source
# File lib/adlint/cc1/format.rb, line 309
def max_length
  min_length
end
min_length() click to toggle source
# File lib/adlint/cc1/format.rb, line 305
def min_length
  format.bytes.count
end
precision() click to toggle source
# File lib/adlint/cc1/format.rb, line 321
def precision
  nil
end
undefined?() click to toggle source
# File lib/adlint/cc1/format.rb, line 281
def undefined?
  false
end
valid_conversion_specifier_character?() click to toggle source
# File lib/adlint/cc1/format.rb, line 301
def valid_conversion_specifier_character?
  false
end
valid_field_width?() click to toggle source
# File lib/adlint/cc1/format.rb, line 289
def valid_field_width?
  false
end
valid_flags?() click to toggle source
# File lib/adlint/cc1/format.rb, line 285
def valid_flags?
  false
end
valid_length_modifier?() click to toggle source
# File lib/adlint/cc1/format.rb, line 297
def valid_length_modifier?
  false
end
valid_precision?() click to toggle source
# File lib/adlint/cc1/format.rb, line 293
def valid_precision?
  false
end
wellformed?() click to toggle source

DESCRIPTION

Checks whether the format string of this directive is the ISO C99 compliant.

RETURN VALUE

Boolean – True if the format string is wellformed.

# File lib/adlint/cc1/format.rb, line 273
def wellformed?
  true
end