Source-highlight Library
srchilite::LanguageInfer Class Reference

Tries to infer the language by inspecting the input file. More...

#include <languageinfer.h>

List of all members.

Public Member Functions

const std::string infer (const std::string &filename)
 Tries to infer the language of the specified inputfile.
const std::string infer (std::istream &stream=std::cin)
 Tries to infer the language of the specified input stream.

Detailed Description

Tries to infer the language by inspecting the input file.

For instance, it looks for something like

 #!/bin/bash
 

at the beginning of the file, or other expression to infer the language


Member Function Documentation

const string srchilite::LanguageInfer::infer ( const std::string &  filename)

Tries to infer the language of the specified inputfile.

Parameters:
filenameThe file to inspect
Returns:
The inferred language, or "" if inference failed
const string srchilite::LanguageInfer::infer ( std::istream &  stream = std::cin)

Tries to infer the language of the specified input stream.

Parameters:
streamThe stream to inspect
Returns:
The inferred language, or "" if inference failed

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