CodeSonar C++ API
[For improved navigation, enable JavaScript.]
Public Member Functions | Static Public Member Functions | Static Public Attributes | Related Functions | List of all members
cs::language Class Reference

Enumeration class: identifies the source language the compilation unit is in. More...

Public Member Functions

csint64 as_integer () const
 Get an integer representation of this. More...
 
std::string as_repr () const
 Get a representation of a language object that includes information useful for debugging. More...
 
std::string as_string () const
 Get a simple string representation of a language object. More...
 
int cmp (const language &other) const
 Comparison function for language, with respect to a stable overall ordering. More...
 
cs_hash_t hash () const
 Hash function for language. More...
 
bool is_machine_code () const
 Check: is a language a machine code language (as opposed to a source language or special language kind)? More...
 
std::string name () const
 Get the name of a language object. More...
 

Static Public Member Functions

static language from_integer (csint64 _inner)
 Construct an instance from an integer representation. More...
 

Static Public Attributes

static const language DOTNETFE_CSHARP
 C# language, .NET front end.
 
static const language EDGCP_C
 C language, EDGCP front end.
 
static const language EDGCP_CPP
 C++ language, EDGCP front end.
 
static const language JFE_JAVA
 Java language, Java front end.
 
static const language META_ACTIONSCRIPT
 ActionScript language, meta front end.
 
static const language META_ADA
 Ada language, meta front end.
 
static const language META_ALGOL
 Algol language, meta front end.
 
static const language META_AWK
 Awk language, meta front end.
 
static const language META_C
 C language, meta front end.
 
static const language META_CFML
 ColdFusion Markup Language, meta front end.
 
static const language META_CLOJURE
 Clojure language, meta fronte end.
 
static const language META_COBOL
 COBOL language, meta front end.
 
static const language META_CPP
 C++ language, meta front end.
 
static const language META_CSHARP
 C# language, meta front end.
 
static const language META_D
 D language, meta front end.
 
static const language META_DART
 Dart language, meta front end.
 
static const language META_EIFFEL
 Eiffel language, meta front end.
 
static const language META_ERLANG
 Erlang language, meta front end.
 
static const language META_FORTH
 Forth language, meta front end.
 
static const language META_FORTRAN
 Fortran language, meta front end.
 
static const language META_FSHARP
 F# language, meta front end.
 
static const language META_GO
 Go language, meta front end.
 
static const language META_HASKELL
 Haskell language, meta front end.
 
static const language META_JAVA
 Java language, meta front end.
 
static const language META_JAVASCRIPT
 JavaScript language, meta front end.
 
static const language META_JULIA
 Julia language, meta front end.
 
static const language META_KOTLIN
 Kotlin language, meta front end.
 
static const language META_LISP
 Lisp language, meta front end.
 
static const language META_LUA
 Lua language, meta front end.
 
static const language META_MATLAB
 MATLAB language, meta front end.
 
static const language META_ML
 ML language, meta front end.
 
static const language META_OBJECTIVE_C
 Objective-C language, meta front end.
 
static const language META_OBJECTPASCAL
 Object Pascal language, meta front end.
 
static const language META_PASCAL
 Pascal language, meta front end.
 
static const language META_PERL
 Perl language, meta front end.
 
static const language META_PHP
 PHP language, meta front end.
 
static const language META_PROLOG
 Prolog language, meta front end.
 
static const language META_PYTHON
 Python language, meta front end.
 
static const language META_R
 R language, meta front end.
 
static const language META_RUBY
 Ruby language, meta front end.
 
static const language META_RUST
 Rust language, meta front end.
 
static const language META_SAS
 SAS language, meta front end.
 
static const language META_SCALA
 Scala language, meta front end.
 
static const language META_SCHEME
 Scheme language, meta front end.
 
static const language META_SMALLTALK
 Smalltalk language, meta front end.
 
static const language META_SQL
 SQL language, meta front end.
 
static const language META_SWIFT
 Swift language, meta front end.
 
static const language META_TEXT
 Plain text language, meta front end.
 
static const language META_TYPESCRIPT
 TypeScript language, meta front end.
 
static const language META_VBSCRIPT
 VBScript language, meta front end.
 
static const language META_VERILOG
 Verilog language, meta front end.
 
static const language META_VHDL
 VHSIC Hardware Description Language, meta front end.
 
static const language META_VISUALBASIC
 Visual Basic language, meta front end.
 
static const language META_VISUALFOXPRO
 Visual FoxPro language, meta front end.
 
static const language SWYX_ARM
 ARM machine code, SWYX front end.
 
static const language SWYX_ARM64
 ARM64 machine code, SWYX front end.
 
static const language SWYX_MIPS
 MIPS machine code, SWYX front end.
 
static const language SWYX_PPC
 PPC machine code, SWYX front end.
 
static const language SWYX_X64
 x64 machine code, SWYX front end.
 
static const language SWYX_X86
 x86 machine code, SWYX front end.
 
static const language SYNTHETIC
 The language associated with the synthesized compilation unit that contains #System_Initialization and all undefined functions (procedure).
 
static const language WILDCARD
 Matches all languages.
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const language &a, const language &b)
 Inequality operator for language. More...
 
bool operator< (const language &a, const language &b)
 Less-than operator for language. More...
 
std::ostream & operator<< (std::ostream &out, const language &a)
 Print a representation of a language object to the specified stream. More...
 
bool operator<= (const language &a, const language &b)
 Less-than-or-equal operator for language. More...
 
bool operator== (const language &a, const language &b)
 Equality operator for language. More...
 
bool operator> (const language &a, const language &b)
 Greater-than operator for language. More...
 
bool operator>= (const language &a, const language &b)
 Greater-than-or-equal operator for language. More...
 

Detailed Description

Enumeration class: identifies the source language the compilation unit is in.

Member Function Documentation

◆ as_integer()

csint64 cs::language::as_integer ( ) const
inline

Get an integer representation of this.

Returns
An integer suitable for use with from_integer(). Invariant: For language x, language.from_integer(x.as_integer()) == x

◆ as_repr()

std::string cs::language::as_repr ( ) const
inline

Get a representation of a language object that includes information useful for debugging.

Returns
The string representation.

◆ as_string()

std::string cs::language::as_string ( ) const
inline

Get a simple string representation of a language object.

Returns
The string representation.

◆ cmp()

int cs::language::cmp ( const language other) const
inline

Comparison function for language, with respect to a stable overall ordering.

Parameters
otherThe language object to compare against.
Returns
An integer N such that:
  • N==0 if the two objects compare equal
  • N<0 if this < other
  • N>0 if this > other

◆ from_integer()

static language cs::language::from_integer ( csint64  _inner)
inlinestatic

Construct an instance from an integer representation.

Parameters
[in]_innerThe integer representation, as returned by as_integer(). Invariant: For language x, language.from_integer(x.as_integer()) == x
Exceptions
cs::result::ERROR_INVALID_ARGUMENTif _inner is not a valid integer representation for a language instance.

◆ hash()

cs_hash_t cs::language::hash ( ) const
inline

Hash function for language.

◆ is_machine_code()

bool cs::language::is_machine_code ( ) const
inline

Check: is a language a machine code language (as opposed to a source language or special language kind)?

Returns
true if called on a machine-code language, false otherwise (including language::WILDCARD, language::SYNTHETIC).

◆ name()

std::string cs::language::name ( ) const
inline

Get the name of a language object.

Returns
The name.

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const language a,
const language b 
)
related

Inequality operator for language.

Parameters
[in]aThe language object to compare.
[in]bThe language object to compare against.
Returns
false if a and b are equal according to language::cmp(), true otherwise.

◆ operator<()

bool operator< ( const language a,
const language b 
)
related

Less-than operator for language.

Parameters
[in]aThe language object to compare.
[in]bThe language object to compare against.
Returns
true if a < b according to language::cmp() , false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const language a 
)
related

Print a representation of a language object to the specified stream.

Parameters
[in]outThe stream to print to.
[in]aThe language object to print.
Returns
void

◆ operator<=()

bool operator<= ( const language a,
const language b 
)
related

Less-than-or-equal operator for language.

Parameters
[in]aThe language object to compare.
[in]bThe language object to compare against.
Returns
true if a <= b according to language::cmp() , false otherwise.

◆ operator==()

bool operator== ( const language a,
const language b 
)
related

Equality operator for language.

Parameters
[in]aThe language object to compare.
[in]bThe language object to compare against.
Returns
true if a and b are equal according to language::cmp(), false otherwise.

◆ operator>()

bool operator> ( const language a,
const language b 
)
related

Greater-than operator for language.

Parameters
[in]aThe language object to compare.
[in]bThe language object to compare against.
Returns
true if a > b according to language::cmp() , false otherwise.

◆ operator>=()

bool operator>= ( const language a,
const language b 
)
related

Greater-than-or-equal operator for language.

Parameters
[in]aThe language object to compare.
[in]bThe language object to compare against.
Returns
true if a >= b according to language::cmp() , false otherwise.

The documentation for this class was generated from the following file: