Doxygen
Loading...
Searching...
No Matches
configimpl.l File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
#include <thread>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdint>
#include "config.h"
#include "regex.h"
#include "configimpl.h"
#include "version.h"
#include "portable.h"
#include "language.h"
#include "configoptions.h"
#include "fileinfo.h"
#include "dir.h"
#include "textstream.h"
#include "dotattributes.h"
#include "debug.h"
#include "doxygen_lex.h"
#include "configimpl.l.h"
Include dependency graph for configimpl.l:

Go to the source code of this file.

Classes

struct  ConfigFileState

Macros

#define YY_NO_INPUT   1
#define YY_NO_UNISTD_H   1
#define SHOW_INCLUDES   0
#define MAX_INCLUDE_DEPTH   10
#define YY_NEVER_INTERACTIVE   1
#define unput_string(yytext, yyleng)
#define YY_INPUT(buf, result, max_size)
#define LEX_NO_REENTRANT

Functions

static const char * stateToString (int state)
static DString configStringRecode (const DString &str, const DString &fromEncoding, const DString &toEncoding)
static bool containsEnvVar (DString &str)
static DString convertToComment (const DString &s, const DString &u)
static bool convertStringToBool (const DString &str, bool &isValid)
static const char * getLexerFILE ()
static int yyread (char *buf, int max_size)
static void checkEncoding ()
static DString stripComment (const DString &s)
static void processStoreRepl (DString &storeReplStr)
static void processString ()
static void processList ()
static FILE * tryPath (const DString &path, const DString &fileName)
static void substEnvVarsInStrList (StringVector &sl)
static void substEnvVarsInString (DString &s)
static FILE * findFile (const DString &fileName)
static void readIncludeFile (const DString &incName)
int yylex (void)
static DString configFileToString (const DString &name)
static void cleanUpPaths (StringVector &str)
static bool checkFileName (const DString &s, const char *optionName)
static void checkList (StringVector list, const char *name, bool equalRequired, bool valueRequired)
static void adjustBoolSetting (const char *depOption, const char *optionName, bool expectedValue)
static void adjustStringSetting (const char *depOption, const char *optionName, const DString &expectedValue)
static void adjustColorStyleSetting (const char *depOption)
static void updateAttribute (DotAttributes &attr, DString name, ConfigObsolete *value)

Variables

static const char * warning_str = "warning: "
static const char * error_str = "error: "
static const char * g_inputString = nullptr
static int g_inputPosition = 0
static int g_yyLineNr = 1
static DString g_yyFileName
static DString g_cmd
static DStringg_string = nullptr
static StringVectorg_list = nullptr
static DString g_listStr
static StringVector g_includePathList
static std::vector< std::unique_ptr< ConfigFileState > > g_includeStack
static bool g_configUpdate = false
static DString g_encoding
static ConfigImplg_config = nullptr
static Config::CompareMode g_compareMode = Config::CompareMode::Full
static DString g_localStoreRepl
static const reg::Ex reEnvVar (R"(\$\‍((\a[\w.-]*)\‍))")
static const reg::Ex reEnvVarExt (R"(\$\‍((\a[\w.-]*\‍(\a[\w.-]*\‍))\‍))")
static const reg::Ex reEnvVarCMake (R"(@\a\w*@)")
static const reg::Ex reEnvVar1CMake (R"(\${\a\w*})")

Macro Definition Documentation

◆ LEX_NO_REENTRANT

#define LEX_NO_REENTRANT

Definition at line 665 of file configimpl.l.

◆ MAX_INCLUDE_DEPTH

#define MAX_INCLUDE_DEPTH   10

Definition at line 83 of file configimpl.l.

Referenced by readIncludeFile().

◆ SHOW_INCLUDES

#define SHOW_INCLUDES   0

Definition at line 52 of file configimpl.l.

◆ unput_string

#define unput_string ( yytext,
yyleng )
Value:
do { for (int i=(int)yyleng-1;i>=0;i--) unput(yytext[i]); } while(0)

Definition at line 657 of file configimpl.l.

◆ YY_INPUT

#define YY_INPUT ( buf,
result,
max_size )
Value:
result=yyread(buf,max_size);
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
Definition code.l:3985

Definition at line 661 of file configimpl.l.

◆ YY_NEVER_INTERACTIVE

#define YY_NEVER_INTERACTIVE   1

Definition at line 84 of file configimpl.l.

◆ YY_NO_INPUT

#define YY_NO_INPUT   1

Definition at line 48 of file configimpl.l.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H   1

Definition at line 49 of file configimpl.l.

Function Documentation

◆ adjustBoolSetting()

void adjustBoolSetting ( const char * depOption,
const char * optionName,
bool expectedValue )
static

Definition at line 1706 of file configimpl.l.

1707{
1708 // lookup option by name
1709 const ConfigValues::Info *option = ConfigValues::instance().get(optionName);
1710 if (option && option->type==ConfigValues::Info::Bool) // safety check
1711 {
1712 if (ConfigValues::instance().*(option->value.b)!=expectedValue) // current value differs from expectation
1713 {
1714 err("When enabling {} the {} option should be {}. I'll adjust it for you.\n",depOption,optionName,expectedValue? "enabled" : "disabled");
1715 ConfigValues::instance().*(option->value.b)=expectedValue; // adjust option
1716 }
1717 }
#define err(fmt,...)
Definition message.h:127
1718}

References adjustBoolSetting(), and err.

Referenced by adjustBoolSetting(), and Config::checkAndCorrect().

◆ adjustColorStyleSetting()

void adjustColorStyleSetting ( const char * depOption)
static

Definition at line 1734 of file configimpl.l.

1735{
1736 auto updateColorStyle = [&depOption](HTML_COLORSTYLE_t curStyle,HTML_COLORSTYLE_t newStyle)
1737 {
1738 err("When enabling '{}' the 'HTML_COLORSTYLE' option should be either 'LIGHT' or 'DARK' but has value '{}'. I'll adjust it for you to '{}'.\n",
1739 depOption,
1740 HTML_COLORSTYLE_enum2str(curStyle),
1741 HTML_COLORSTYLE_enum2str(newStyle));
1742 Config_updateEnum(HTML_COLORSTYLE,newStyle);
1743 };
1744 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
1745 switch (colorStyle)
1746 {
1747 case HTML_COLORSTYLE_t::LIGHT:
1748 case HTML_COLORSTYLE_t::DARK:
1749 // no adjustment needed
1750 break;
1751 case HTML_COLORSTYLE_t::AUTO_LIGHT:
1752 case HTML_COLORSTYLE_t::TOGGLE:
1753 updateColorStyle(colorStyle,HTML_COLORSTYLE_t::LIGHT);
1754 break;
1755 case HTML_COLORSTYLE_t::AUTO_DARK:
1756 updateColorStyle(colorStyle,HTML_COLORSTYLE_t::DARK);
1757 break;
1758 }
#define Config_updateEnum(name, value)
Definition config.h:42
#define Config_getEnum(name)
Definition config.h:35
1759}

References adjustColorStyleSetting(), Config_getEnum, Config_updateEnum, and err.

Referenced by adjustColorStyleSetting(), and Config::checkAndCorrect().

◆ adjustStringSetting()

void adjustStringSetting ( const char * depOption,
const char * optionName,
const DString & expectedValue )
static

Definition at line 1720 of file configimpl.l.

1721{
1722 // lookup option by name
1723 const ConfigValues::Info *option = ConfigValues::instance().get(optionName);
1724 if (option && option->type==ConfigValues::Info::String) // safety check
1725 {
1726 if (ConfigValues::instance().*(option->value.s)!=expectedValue) // current value differs from expectation
1727 {
1728 err("When enabling {} the {} option should have value '{}'. I'll adjust it for you.\n",depOption,optionName,expectedValue);
1729 ConfigValues::instance().*(option->value.s)=expectedValue; // adjust option
1730 }
1731 }
1732}

References adjustStringSetting(), and err.

Referenced by adjustStringSetting(), and Config::checkAndCorrect().

◆ checkEncoding()

void checkEncoding ( )
static

Definition at line 726 of file configimpl.l.

727{
728 ConfigString *option = dynamic_cast<ConfigString*>(g_config->get("DOXYFILE_ENCODING"));
729 g_encoding = *option->valueRef();
ConfigOption * get(const DString &name) const
Definition configimpl.h:396
Class representing a string type option.
Definition configimpl.h:184
DString * valueRef()
Definition configimpl.h:197
static ConfigImpl * g_config
Definition configimpl.l:653
static DString g_encoding
Definition configimpl.l:652
730}

References checkEncoding(), g_config, g_encoding, ConfigImpl::get(), and ConfigString::valueRef().

Referenced by checkEncoding(), and processString().

◆ checkFileName()

bool checkFileName ( const DString & s,
const char * optionName )
static

Definition at line 1658 of file configimpl.l.

1659{
1660 DString val = s.stripWhiteSpace().lower();
1661 if ((val=="yes" || val=="true" || val=="1" || val=="all") ||
1662 (val=="no" || val=="false" || val=="0" || val=="none"))
1663 {
1664 err("file name expected for option {}, got {} instead. Ignoring...\n",optionName,s);
1665 return false;
1666 }
1667 return true;
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:88
DString lower() const
Definition dstring.h:330
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:341
1668}

References checkFileName(), err, DString::lower(), and DString::stripWhiteSpace().

Referenced by Config::checkAndCorrect(), and checkFileName().

◆ checkList()

void checkList ( StringVector list,
const char * name,
bool equalRequired,
bool valueRequired )
inlinestatic

Definition at line 1676 of file configimpl.l.

1677{
1678 for (const auto &s: list)
1679 {
1680 DString item = s;
1681 item=item.stripWhiteSpace();
1682 size_t i=item.find('=');
1683 if (i==DString::npos && equalRequired)
1684 {
1685 err("Illegal format for option {}, no equal sign ('=') specified for item '{}'\n",name,item);
1686 }
1687 if (i!=DString::npos)
1688 {
1689 DString myName=item.left(i).stripWhiteSpace();
1690 if (myName.empty())
1691 {
1692 err("Illegal format for option {}, no name specified for item '{}'\n",name,item);
1693 }
1694 else if (valueRequired)
1695 {
1696 DString myValue=item.mid(i+1).stripWhiteSpace();
1697 if (myValue.empty())
1698 {
1699 err("Illegal format for option {}, no value specified for item '{}'\n",name,item);
1700 }
1701 }
1702 }
1703 }
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:322
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:152
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:182
size_t find(char c, size_t pos=0) const
Definition dstring.h:243
DString left(size_t len) const
Definition dstring.h:310
1704}

References checkList(), DString::empty(), err, DString::find(), DString::left(), DString::mid(), DString::npos, and DString::stripWhiteSpace().

Referenced by Config::checkAndCorrect(), and checkList().

◆ cleanUpPaths()

void cleanUpPaths ( StringVector & str)
static

Definition at line 1639 of file configimpl.l.

1640{
1641 for (size_t i=0;i<str.size();i++)
1642 {
1643 std::string path = str[i];
1644 std::replace(path.begin(),path.end(),'\\','/');
1645 if ((path[0]!='/' && (path.size()<=2 || path[1]!=':')) || path[path.size()-1]!='/')
1646 {
1647 FileInfo fi(path);
1648 if (fi.exists() && fi.isDir())
1649 {
1650 path = fi.absFilePath();
1651 if (path[path.size()-1]!='/') path+='/';
1652 }
1653 }
1654 str[i]=path;
1655 }
Minimal replacement for QFileInfo.
Definition fileinfo.h:26
1656}

References FileInfo::absFilePath(), cleanUpPaths(), FileInfo::exists(), and FileInfo::isDir().

Referenced by Config::checkAndCorrect(), and cleanUpPaths().

◆ configFileToString()

DString configFileToString ( const DString & name)
static

Definition at line 1578 of file configimpl.l.

1579{
1580 if (name.empty()) return DString();
DString()=default
1581
1582 auto stream2string = [](std::istream &in) -> std::string
1583 {
1584 std::string ret;
1585 char buffer[4096];
1586 while (in.read(buffer, sizeof(buffer))) ret.append(buffer, sizeof(buffer));
1587 ret.append(buffer, static_cast<uint32_t>(in.gcount()));
1588 if (!ret.empty() && ret[ret.length()-1]!='\n') ret+='\n'; // to help the scanner
1589 return ret;
1590 };
1591
1592 if (name=="-") // read from stdin
1593 {
1594 // read contents from stdin into contents string
1595 return stream2string(std::cin);
1596 }
1597 else // read from file
1598 {
1599 std::ifstream f = Portable::openInputStream(name);
1600 if (!f.is_open())
1601 {
1602 ConfigImpl::config_term("file '{}' not found or could not be opened\n",name);
1603 return "";
1604 }
1605 return stream2string(f);
1606 }
static void config_term(fmt::format_string< Args... > fmt, Args &&... args)
Definition configimpl.h:617
std::ifstream openInputStream(const DString &name, bool binary=false, bool openAtEnd=false)
Definition portable.cpp:676
1607}

References ConfigImpl::config_term(), configFileToString(), DString::DString(), DString::empty(), and Portable::openInputStream().

Referenced by configFileToString(), and ConfigImpl::parse().

◆ configStringRecode()

DString configStringRecode ( const DString & str,
const DString & fromEncoding,
const DString & toEncoding )
static

Definition at line 690 of file configimpl.l.

694{
695 if (inputEncoding.empty() || outputEncoding.empty() || inputEncoding==outputEncoding) return str;
696 size_t inputSize=str.length();
697 size_t outputSize=inputSize*4;
698 DString output(outputSize, DString::ExplicitSize);
699 void *cd = portable_iconv_open(outputEncoding.data(),inputEncoding.data());
700 if (cd==reinterpret_cast<void *>(-1))
701 {
702 ConfigImpl::config_term("Error: unsupported character conversion: '{}'->'{}'\n"
703 "Check the 'DOXYFILE_ENCODING' setting in the config file!\n",
704 inputEncoding,outputEncoding);
705 }
706 size_t iLeft=inputSize;
707 size_t oLeft=outputSize;
708 const char *inputPtr = str.data();
709 char *outputPtr = output.rawData();
710 if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
711 {
712 outputSize-=oLeft;
713 output.resize(outputSize);
714 output.at(outputSize)='\0';
715 //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,qPrint(srcBuf));
716 }
717 else
718 {
719 ConfigImpl::config_term("Error: failed to translate characters from {} to {}: {}\n",
720 inputEncoding,outputEncoding,strerror(errno));
721 }
723 return output;
@ ExplicitSize
Definition dstring.h:135
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:161
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:155
int portable_iconv_close(void *cd)
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
void * portable_iconv_open(const char *tocode, const char *fromcode)
724}

References DString::at(), ConfigImpl::config_term(), configStringRecode(), DString::data(), DString::empty(), DString::ExplicitSize, DString::length(), portable_iconv(), portable_iconv_close(), portable_iconv_open(), DString::rawData(), and DString::resize().

Referenced by configStringRecode(), processList(), processStoreRepl(), processString(), and ConfigOption::writeStringValue().

◆ containsEnvVar()

bool containsEnvVar ( DString & str)
static

Definition at line 1402 of file configimpl.l.

1403{
1404 reg::Match m;
1405 std::string s = str.str();
const std::string & str() const
Definition dstring.h:649
Object representing the matching results.
Definition regex.h:154
static const reg::Ex reEnvVarExt(R"(\$\‍((\a[\w.-]*\‍(\a[\w.-]*\‍))\‍))")
static const reg::Ex reEnvVar(R"(\$\‍((\a[\w.-]*)\‍))")
static const reg::Ex reEnvVar1CMake(R"(\${\a\w*})")
static const reg::Ex reEnvVarCMake(R"(@\a\w*@)")
bool search(std::string_view str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition regex.cpp:847
1407}

References containsEnvVar(), reEnvVar, reEnvVar1CMake, reEnvVarCMake, reEnvVarExt, reg::search(), and DString::str().

Referenced by ConfigBool::compareDoxyfile(), ConfigInt::compareDoxyfile(), containsEnvVar(), ConfigBool::convertStrToVal(), ConfigEnum::convertStrToVal(), and ConfigInt::convertStrToVal().

◆ convertStringToBool()

bool convertStringToBool ( const DString & str,
bool & isValid )
static

Definition at line 217 of file configimpl.l.

218{
219 isValid=false;
220 DString val = str.stripWhiteSpace().lower();
221 if (!val.empty())
222 {
223 if (val=="yes" || val=="true" || val=="1" || val=="all")
224 {
225 isValid=true;
226 return true;
227 }
228 else if (val=="no" || val=="false" || val=="0" || val=="none")
229 {
230 isValid=true;
231 return false;
232 }
233 }
234 return false;
235}

References convertStringToBool(), DString::empty(), DString::lower(), and DString::stripWhiteSpace().

Referenced by convertStringToBool(), ConfigBool::convertStrToVal(), and Config::updateObsolete().

◆ convertToComment()

DString convertToComment ( const DString & s,
const DString & u )
static

Definition at line 88 of file configimpl.l.

89{
90 //printf("convertToComment(%s)=%s\n",qPrint(s),qPrint(u));
91 DString result;
92 if (!s.empty())
93 {
95 const char *p=tmp.data();
96 char c = 0;
97 if (p)
98 {
99 result+="#";
100 if (*p && *p!='\n')
101 {
102 result+=" ";
103 }
104 while ((c=*p++))
105 {
106 if (c=='\n')
107 {
108 result+="\n#";
109 if (*p && *p!='\n')
110 {
111 result+=" ";
112 }
113 }
114 else result+=c;
115 }
116 result+='\n';
117 }
118 }
119 if (!u.empty())
120 {
121 if (!result.empty()) result+='\n';
122 result+= u;
123 }
124 return result;
125}

References convertToComment(), DString::data(), DString::empty(), and DString::stripWhiteSpace().

Referenced by convertToComment(), ConfigBool::writeTemplate(), ConfigEnum::writeTemplate(), ConfigImpl::writeTemplate(), ConfigInt::writeTemplate(), ConfigList::writeTemplate(), and ConfigString::writeTemplate().

◆ findFile()

FILE * findFile ( const DString & fileName)
static

Definition at line 941 of file configimpl.l.

942{
943 if (fileName.empty())
944 {
945 return 0;
946 }
947 if (Portable::isAbsolutePath(fileName))
948 {
949 return tryPath(DString(), fileName);
950 }
952 for (const auto &s : g_includePathList)
953 {
954 FILE *f = tryPath(s,fileName);
955 if (f) return f;
956 }
957 // try cwd if g_includePathList fails
958 return tryPath(".",fileName);
static FILE * tryPath(const DString &path, const DString &fileName)
Definition configimpl.l:925
static StringVector g_includePathList
Definition configimpl.l:649
static void substEnvVarsInStrList(StringVector &sl)
bool isAbsolutePath(const DString &fileName)
Definition portable.cpp:497
959}

References DString::DString(), DString::empty(), findFile(), g_includePathList, Portable::isAbsolutePath(), substEnvVarsInStrList(), and tryPath().

Referenced by findFile(), and readIncludeFile().

◆ getLexerFILE()

const char * getLexerFILE ( )
inlinestatic

Definition at line 664 of file configimpl.l.

664{return __FILE__;}

References getLexerFILE().

Referenced by getLexerFILE(), getLexerFILE(), getLexerFILE(), and getLexerFILE().

◆ processList()

void processList ( )
static

Definition at line 828 of file configimpl.l.

829{
830 bool allowCommaAsSeparator = g_cmd!="PREDEFINED";
static DString g_cmd
Definition configimpl.l:645
831
833 size_t l = s.length();
static DString stripComment(const DString &s)
Definition configimpl.l:732
static DString g_listStr
Definition configimpl.l:648
834
835 DString elemStr;
836 bool wasQuote=false;
837
838 // helper to push elemStr to the list and clear it
839 auto addElem = [&elemStr,&wasQuote]()
840 {
841 if (!elemStr.empty())
842 {
843 DString e = configStringRecode(elemStr,g_encoding,"UTF-8");
844 //printf("Processed list element '%s'\n",qPrint(e));
845 if (wasQuote) e = "\""+e+"\"";
846 wasQuote = false;
847 g_list->push_back(e.str());
848 elemStr="";
849 }
850 };
static StringVector * g_list
Definition configimpl.l:647
static DString configStringRecode(const DString &str, const DString &fromEncoding, const DString &toEncoding)
Definition configimpl.l:690
851
852 bool needsSeparator=false;
853 bool insideQuote=false;
854 bool warned=false;
855 for (size_t i=0;i<l;i++)
856 {
857 char c = s.at(i);
858 if (!needsSeparator && c=='\\') // escaped character
859 {
860 if (i<l-1 && s.at(i+1)=='"') // unescape the quote character
861 {
862 elemStr+='"';
863 }
864 else if (insideQuote && i<l-2 && s.at(i+1)=='\\' && s.at(i+2)=='"') // escaped "\" at the end of a quoted section
865 {
866 elemStr+="\\";
867 }
868 else // keep other escaped characters in escaped form
869 {
870 elemStr+=c;
871 if (i<l-1)
872 {
873 elemStr+=s.at(i+1);
874 }
875 }
876 i++; // skip over the escaped character
877 }
878 else if (!needsSeparator && c=='"') // quote character
879 {
880 if (!insideQuote)
881 {
882 insideQuote=true;
883 wasQuote=true;
884 }
885 else // this quote ends an element
886 {
887 insideQuote=false;
888 needsSeparator=true;
889 }
890 }
891 else if (!insideQuote && ((c==',' && allowCommaAsSeparator) || isspace(c))) // separator
892 {
893 needsSeparator=false;
894 addElem();
895 }
896 else // normal content character
897 {
898 if (needsSeparator)
899 {
900 if (!warned)
901 {
902 ConfigImpl::config_warn("Invalid value for '{}' tag at line {}, file {}: Values in list '{}' are not properly space {}separated\n",
903 g_cmd,g_yyLineNr,g_yyFileName,g_listStr.stripWhiteSpace(),allowCommaAsSeparator?"or comma ":"");
904 warned=true;
905 }
906 needsSeparator=false;
907 i--; // try the character again as part of a new element
908 addElem();
909 }
910 else
911 {
912 elemStr+=c;
913 }
914 }
915 }
916 // add last part
917 addElem();
918 if (insideQuote)
919 {
920 ConfigImpl::config_warn("Invalid value for '{}' tag at line {}, file {}: Values in list '{}' are not properly quoted\n",
922 }
static void config_warn(fmt::format_string< Args... > fmt, Args &&... args)
Definition configimpl.h:623
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:690
static DString g_yyFileName
Definition configimpl.l:644
static int g_yyLineNr
Definition configimpl.l:643
923}

References DString::at(), ConfigImpl::config_warn(), configStringRecode(), DString::empty(), g_cmd, g_encoding, g_list, g_listStr, g_yyFileName, g_yyLineNr, DString::length(), processList(), DString::str(), stripComment(), and DString::stripWhiteSpace().

Referenced by processList().

◆ processStoreRepl()

void processStoreRepl ( DString & storeReplStr)
static

Definition at line 760 of file configimpl.l.

761{
762 // strip leading and trailing whitespace
763 DString s = stripComment(storeReplStr.stripWhiteSpace());
764 // recode the string
765 storeReplStr=configStringRecode(s,g_encoding,"UTF-8");
766}

References configStringRecode(), g_encoding, processStoreRepl(), stripComment(), and DString::stripWhiteSpace().

Referenced by processStoreRepl().

◆ processString()

void processString ( )
static

Definition at line 768 of file configimpl.l.

769{
770 // strip leading and trailing whitespace
772 size_t l = s.length();
static DString * g_string
Definition configimpl.l:646
773
774 // remove surrounding quotes if present (and not escaped)
775 if (l>=2 && s.at(0)=='"' && s.at(l-1)=='"' && // remove quotes
776 (s.at(l-2)!='\\' || (s.at(l-2)=='\\' && s.at(l-3)=='\\')))
777 {
778 s=s.mid(1,s.length()-2);
779 l=s.length();
780 }
781
782 // check for invalid and/or escaped quotes
783 bool warned=false;
784 DString result;
785 for (size_t i=0;i<l;i++)
786 {
787 char c = s.at(i);
788 if (c=='\\') // escaped character
789 {
790 if (i<l-1 && s.at(i+1)=='"') // unescape the quote character
791 {
792 result+='"';
793 }
794 else // keep other escaped characters in escaped form
795 {
796 result+=c;
797 if (i<l-1)
798 {
799 result+=s.at(i+1);
800 }
801 }
802 i++; // skip over the escaped character
803 }
804 else if (c=='"') // unescaped quote
805 {
806 if (!warned)
807 {
808 ConfigImpl::config_warn("Invalid value for '{}' tag at line {}, file {}: Value '{}' is not properly quoted\n",
810 }
811 warned=true;
812 }
813 else // normal character
814 {
815 result+=c;
816 }
817 }
818
819 // recode the string
820 *g_string=configStringRecode(result,g_encoding,"UTF-8");
821
822 // update encoding
static void checkEncoding()
Definition configimpl.l:726
824
825 //printf("Processed string '%s'\n",qPrint(g_string));
826}

References DString::at(), checkEncoding(), ConfigImpl::config_warn(), configStringRecode(), g_cmd, g_encoding, g_string, g_yyFileName, g_yyLineNr, DString::length(), DString::mid(), processString(), stripComment(), and DString::stripWhiteSpace().

Referenced by processString().

◆ readIncludeFile()

void readIncludeFile ( const DString & incName)
static

Definition at line 961 of file configimpl.l.

962{
963 if (g_includeStack.size()==MAX_INCLUDE_DEPTH) {
964 ConfigImpl::config_term("maximum include depth ({:d}) reached, {} is not included. Aborting...\n",
965 MAX_INCLUDE_DEPTH,incName);
966 }
static std::vector< std::unique_ptr< ConfigFileState > > g_includeStack
Definition configimpl.l:650
#define MAX_INCLUDE_DEPTH
Definition configimpl.l:83
967
968 DString inc = incName;
970 inc = inc.stripWhiteSpace();
971 size_t incLen = inc.length();
972 if (incLen>0 && inc.at(0)=='"' && inc.at(incLen-1)=='"') // strip quotes
973 {
974 inc=inc.mid(1,incLen-2);
975 }
static void substEnvVarsInString(DString &s)
976
977 FILE *f;
978
979 if ((f=findFile(inc))) // see if the include file can be found
980 {
981 // For debugging
static FILE * findFile(const DString &fileName)
Definition configimpl.l:941
982#if SHOW_INCLUDES
983 for (size_t i=0;i<g_includeStack.size();i++) msg(" ");
984 msg("@INCLUDE = {}: parsing...\n",inc);
#define msg(fmt,...)
Definition message.h:94
985#endif
986
987 // store the state of the old file
989 fs->oldState=YY_CURRENT_BUFFER;
990 fs->lineNr=g_yyLineNr;
992 fs->filePtr=f;
993 // push the state on the stack
994 g_includeStack.push_back(std::unique_ptr<ConfigFileState>(fs));
995 // set the scanner to the include file
996 yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
997 fs->newState=YY_CURRENT_BUFFER;
998 g_yyFileName=inc;
999 }
1000 else
1001 {
1002 ConfigImpl::config_term("@INCLUDE = {}: not found!\n",inc);
1003 }
#define YY_BUF_SIZE
Definition commentcnv.l:19
YY_BUFFER_STATE newState
Definition configimpl.l:637
YY_BUFFER_STATE oldState
Definition configimpl.l:636
1004}

References DString::at(), ConfigImpl::config_term(), ConfigFileState::fileName, ConfigFileState::filePtr, findFile(), g_includeStack, g_yyFileName, g_yyLineNr, DString::length(), ConfigFileState::lineNr, MAX_INCLUDE_DEPTH, DString::mid(), msg, ConfigFileState::newState, ConfigFileState::oldState, readIncludeFile(), DString::stripWhiteSpace(), substEnvVarsInString(), and YY_BUF_SIZE.

Referenced by readIncludeFile().

◆ stateToString()

const char * stateToString ( int state)
static

◆ stripComment()

DString stripComment ( const DString & s)
static

Definition at line 732 of file configimpl.l.

733{
734 // check if there is a comment at the end of the string
735 bool insideQuote=false;
736 size_t l = s.length();
737 for (size_t i=0;i<l;i++)
738 {
739 char c = s.at(i);
740 if (c=='\\') // skip over escaped characters
741 {
742 i++;
743 }
744 else if (c=='"') // toggle inside/outside quotation
745 {
746 insideQuote=!insideQuote;
747 }
748 else if (!insideQuote && c=='#') // found start of a comment
749 {
750 if (i<l-1 && s.at(i+1)=='#') // ## -> user comment
751 {
752 g_config->appendUserComment(s.mid(i)+"\n");
753 }
754 return s.left(i).stripWhiteSpace();
755 }
756 }
757 return s;
void appendUserComment(const DString &u)
Definition configimpl.h:568
758}

References ConfigImpl::appendUserComment(), DString::at(), g_config, DString::left(), DString::length(), DString::mid(), stripComment(), and DString::stripWhiteSpace().

Referenced by processList(), processStoreRepl(), processString(), and stripComment().

◆ substEnvVarsInString()

void substEnvVarsInString ( DString & s)
static

Definition at line 1409 of file configimpl.l.

1410{
1411 if (str.empty()) return;
1412 auto replace = [](const std::string &s, const reg::Ex &re) -> std::string
1413 {
1414 reg::Iterator it(s,re);
1416 std::string result;
1417 size_t p = 0;
1418 for (; it!=end ; ++it)
1419 {
1420 const auto &match = *it;
1421 size_t i = match.position();
1422 size_t l = match.length();
1423 result+=s.substr(p,i-p);
1424 std::string matchContents = match[1].str();
1425 DString env=Portable::getenv(matchContents); // get content of $(..) match
1426 substEnvVarsInString(env); // recursively expand variables if needed.
1427 result+=env.str();
1428 p=i+l;
1429 }
1430 result+=s.substr(p);
1431 return result;
1432 };
Class representing a regular expression.
Definition regex.h:39
Class to iterate through matches.
Definition regex.h:239
DirIterator end(const DirIterator &) noexcept
Definition dir.cpp:176
DString getenv(const DString &variable)
Definition portable.cpp:321
std::string replace(std::string_view str, const Ex &re, std::string_view replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
Definition regex.cpp:869
bool match(std::string_view str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition regex.cpp:858
1433
1434 str = DString(replace(replace(str.str(),reEnvVar),reEnvVarExt)).stripWhiteSpace();
1435}

References DString::DString(), DString::empty(), end(), Portable::getenv(), reEnvVar, reEnvVarExt, DString::str(), DString::stripWhiteSpace(), and substEnvVarsInString().

Referenced by readIncludeFile(), ConfigBool::substEnvVars(), ConfigEnum::substEnvVars(), ConfigInt::substEnvVars(), ConfigString::substEnvVars(), substEnvVarsInString(), and substEnvVarsInStrList().

◆ substEnvVarsInStrList()

void substEnvVarsInStrList ( StringVector & sl)
static

Definition at line 1437 of file configimpl.l.

1438{
1439 StringVector results;
1440 for (const auto &s : sl)
1441 {
1442 DString result = s;
1443 bool wasQuoted = ((result.at(0)=='"') && (result.at(result.length()-1)=='"'));
1444 if (wasQuoted)
1445 {
1446 result = result.mid(1,result.length()-2);
1447 }
1448 else
1449 {
1450 wasQuoted = (result.find(' ')!=DString::npos) || (result.find('\t')!=DString::npos) || (result.find('"')!=DString::npos);
1451 }
1452 // here we strip the quote again
1453 substEnvVarsInString(result);
std::vector< std::string > StringVector
Definition containers.h:33
1454
1455 //printf("Result %s was quoted=%d\n",qPrint(result),wasQuoted);
1456
1457 if (!wasQuoted) /* as a result of the expansion, a single string
1458 may have expanded into a list, which we'll
1459 add to sl. If the original string already
1460 contained multiple elements no further
1461 splitting is done to allow quoted items with spaces! */
1462 {
1463 int l = static_cast<int>(result.length());
1464 int p = 0;
1465 // skip spaces
1466 // search for a "word"
1467 for (int i=0;i<l;i++)
1468 {
1469 char c=0;
1470 // skip until start of new word
1471 while (i<l && ((c=result.at(i))==' ' || c=='\t')) i++;
1472 p=i; // p marks the start index of the word
1473 // skip until end of a word
1474 while (i<l && ((c=result.at(i))!=' ' && c!='\t' && c!='"')) i++;
1475 if (i<l) // not at the end of the string
1476 {
1477 if (c=='"') // word within quotes
1478 {
1479 p=i+1;
1480 for (i++;i<l;i++)
1481 {
1482 c=result.at(i);
1483 if (c=='"') // end quote
1484 {
1485 results.push_back(result.mid(p,i-p).str());
1486 p=i+1;
1487 break;
1488 }
1489 else if (c=='\\') // skip escaped stuff
1490 {
1491 i++;
1492 }
1493 }
1494 }
1495 else if (c==' ' || c=='\t') // separator
1496 {
1497 if (i>p) results.push_back(result.mid(p,i-p).str());
1498 p=i+1;
1499 }
1500 }
1501 }
1502 if (p!=l) // add the leftover as a string
1503 {
1504 results.push_back(result.right(l-p).str());
1505 }
1506 }
1507 else // just goto the next element in the list
1508 {
1509 if (!result.empty()) results.push_back(result.str());
1510 }
1511 }
1512 sl = results;
DString right(size_t len) const
Definition dstring.h:315
1513}

References DString::at(), DString::empty(), DString::find(), DString::length(), DString::mid(), DString::npos, DString::right(), DString::str(), substEnvVarsInString(), and substEnvVarsInStrList().

Referenced by findFile(), ConfigList::substEnvVars(), and substEnvVarsInStrList().

◆ tryPath()

FILE * tryPath ( const DString & path,
const DString & fileName )
static

Definition at line 925 of file configimpl.l.

926{
927 DString absName=(!path.empty() ? path+"/"+fileName : fileName);
928 FileInfo fi(absName.str());
929 if (fi.exists() && fi.isFile())
930 {
931 FILE *f=Portable::fopen(absName,"r");
932 if (!f) ConfigImpl::config_err("could not open file {} for reading\n",absName);
933 return f;
934 }
935 return 0;
static void config_err(fmt::format_string< Args... > fmt, Args &&... args)
Definition configimpl.h:611
FILE * fopen(const DString &fileName, const DString &mode)
Definition portable.cpp:349
936}

References ConfigImpl::config_err(), DString::empty(), FileInfo::exists(), Portable::fopen(), FileInfo::isFile(), DString::str(), and tryPath().

Referenced by findFile(), and tryPath().

◆ updateAttribute()

void updateAttribute ( DotAttributes & attr,
DString name,
ConfigObsolete * value )
static

Definition at line 2254 of file configimpl.l.

2255{
2256 attr.updateValue(name,*value->valueStringRef());
DString * valueStringRef()
Definition configimpl.h:292
void updateValue(const DString &key, const DString &inpValue)
2257}

References updateAttribute(), DotAttributes::updateValue(), and ConfigObsolete::valueStringRef().

Referenced by updateAttribute(), and Config::updateObsolete().

◆ yylex()

int yylex ( void )

Definition at line 1021 of file configimpl.l.

1027 {
1028 g_config->appendUserComment(yytext);
1029 g_yyLineNr++;
1030 }
1031<Start>"#".*"\n" { /* normal comment */
1032 g_yyLineNr++;
1033 }
1034
1035 /*-------------- TAG start ---------------*/
1036
1037<Start>[a-z_A-Z][a-z_A-Z0-9]*[ \t]*"=" { g_cmd=yytext;
1039 ConfigOption *option = g_config->get(g_cmd);
1040 if (option==0) // oops not known
1041 {
1042 ConfigImpl::config_warn("ignoring unsupported tag '{}' at line {}, file {}\n",
1044 BEGIN(SkipInvalid);
1045 }
1046 else // known tag
1047 {
1049 option->setEncoding(g_encoding);
1050 switch(option->kind())
1051 {
1053 // shouldn't get here!
1054 BEGIN(SkipInvalid);
1055 break;
1057 g_list = dynamic_cast<ConfigList *>(option)->valueRef();
1058 g_list->clear();
1059 g_listStr="";
1060 BEGIN(GetStrList);
1061 break;
1063 g_string = dynamic_cast<ConfigEnum *>(option)->valueRef();
1064 g_string->clear();
1065 BEGIN(GetString);
1066 break;
1068 g_string = dynamic_cast<ConfigString *>(option)->valueRef();
1069 g_string->clear();
1070 BEGIN(GetString);
1071 break;
1073 g_string = dynamic_cast<ConfigInt *>(option)->valueStringRef();
1074 g_string->clear();
1075 BEGIN(GetString);
1076 break;
1078 g_string = dynamic_cast<ConfigBool *>(option)->valueStringRef();
1079 g_string->clear();
1080 BEGIN(GetString);
1081 break;
1083 if (g_configUpdate)
1084 {
1085 ConfigImpl::config_warn("Tag '{}' at line {} of file '{}' has become obsolete.\n"
1086 " This tag has been removed.\n", g_cmd,g_yyLineNr,g_yyFileName);
1087 }
1088 else
1089 {
1090 ConfigImpl::config_warn("Tag '{}' at line {} of file '{}' has become obsolete.\n"
1091 " To avoid this warning please remove this line from your configuration "
1092 "file or upgrade it using \"doxygen -u\"\n", g_cmd,g_yyLineNr,g_yyFileName);
1093 }
1094 dynamic_cast<ConfigObsolete*>(option)->markAsPresent();
1095 if (dynamic_cast<ConfigObsolete*>(option)->orgType()==ConfigOption::O_List)
1096 {
1097 g_list = dynamic_cast<ConfigObsolete*>(option)->valueListRef();
1098 g_list->clear();
1099 g_listStr="";
1100 BEGIN(GetStrList);
1101 }
1102 else
1103 {
1104 g_string = dynamic_cast<ConfigObsolete*>(option)->valueStringRef();
1105 g_string->clear();
1106 BEGIN(GetString);
1107 }
1108 break;
1110 if (g_configUpdate)
1111 {
1112 ConfigImpl::config_warn("Tag '{}' at line {} of file '{}' belongs to an option that was not enabled at compile time.\n"
1113 " This tag has been removed.\n", g_cmd,g_yyLineNr,g_yyFileName);
1114 }
1115 else
1116 {
1117 ConfigImpl::config_warn("Tag '{}' at line {} of file '{}' belongs to an option that was not enabled at compile time.\n"
1118 " To avoid this warning please remove this line from your configuration "
1119 "file or upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n", g_cmd,g_yyLineNr,g_yyFileName);
1120 }
1121 BEGIN(SkipInvalid);
1122 break;
1123 }
1124 }
1125 }
Class representing a Boolean type option.
Definition configimpl.h:251
Class representing an enum type option.
Definition configimpl.h:153
DString takeUserComment()
Definition configimpl.h:590
Class representing an integer type option.
Definition configimpl.h:216
Class representing a list type option.
Definition configimpl.h:121
Section marker for obsolete options.
Definition configimpl.h:281
Abstract base class for any configuration option.
Definition configimpl.h:35
void setEncoding(const DString &e)
Definition configimpl.h:72
void setUserComment(const DString &u)
Definition configimpl.h:73
@ O_Disabled
Disabled compile time option.
Definition configimpl.h:51
@ O_List
A list of items.
Definition configimpl.h:45
@ O_Enum
A fixed set of items.
Definition configimpl.h:46
@ O_Bool
A boolean value.
Definition configimpl.h:49
@ O_String
A single item.
Definition configimpl.h:47
@ O_Obsolete
An obsolete option.
Definition configimpl.h:50
@ O_Int
An integer value.
Definition configimpl.h:48
@ O_Info
A section header.
Definition configimpl.h:44
OptionType kind() const
Definition configimpl.h:66
void clear()
Definition dstring.h:218
static bool g_configUpdate
Definition configimpl.l:651
1126<Start>[a-z_A-Z][a-z_A-Z0-9]*[ \t]*"+=" { g_cmd=yytext;
1128 ConfigOption *option = g_config->get(g_cmd);
1129 if (option==0) // oops not known
1130 {
1131 ConfigImpl::config_warn("ignoring unsupported tag '{}' at line {}, file {}\n",
1133 BEGIN(SkipInvalid);
1134 }
1135 else // known tag
1136 {
1138 switch(option->kind())
1139 {
1141 // shouldn't get here!
1142 BEGIN(SkipInvalid);
1143 break;
1145 g_list = dynamic_cast<ConfigList *>(option)->valueRef();
1146 g_listStr="";
1147 BEGIN(GetStrList);
1148 break;
1153 ConfigImpl::config_warn("operator += not supported for '{}'. Ignoring line at line {}, file {}\n",
1154 yytext,g_yyLineNr,g_yyFileName);
1155 BEGIN(SkipInvalid);
1156 break;
1158 ConfigImpl::config_warn("Tag '{}' at line {} of file {} has become obsolete.\n"
1159 "To avoid this warning please update your configuration "
1160 "file using \"doxygen -u\"\n", g_cmd,g_yyLineNr,g_yyFileName);
1161 if (dynamic_cast<ConfigObsolete*>(option)->orgType()==ConfigOption::O_List)
1162 {
1163 g_list = dynamic_cast<ConfigObsolete*>(option)->valueListRef();
1164 g_listStr="";
1165 BEGIN(GetStrList);
1166 }
1167 else
1168 {
1169 BEGIN(SkipInvalid);
1170 }
1171 break;
1173 ConfigImpl::config_warn("Tag '{}' at line {} of file {} belongs to an option that was not enabled at compile time.\n"
1174 "To avoid this warning please remove this line from your configuration "
1175 "file, upgrade it using \"doxygen -u\", or recompile doxygen with this feature enabled.\n",
1177 BEGIN(SkipInvalid);
1178 break;
1179 }
1180 }
1181 }
1182
1183 /*-------------- INCLUDE* ---------------*/
1184
1185<Start>"@INCLUDE_PATH"[ \t]*"=" { BEGIN(GetStrList); g_list=&g_includePathList; g_list->clear(); g_listStr=""; }
1186 /* include a g_config file */
1187<Start>"@INCLUDE"[ \t]*"=" { BEGIN(Include);}
1188<Start>"$("{REGEX_a}({REGEX_w}|[.-])*")" | // e.g. $(HOME)
1189<Start>"$("{REGEX_a}({REGEX_w}|[.-])*"("{REGEX_a}({REGEX_w}|[.-])*"))" { // e.g. $(PROGRAMFILES(X86))
1190 g_localStoreRepl = yytext;
1192 {
1193 BEGIN(StoreRepl);
1194 }
1195 else
1196 {
1199 }
1200 }
#define unput_string(yytext, yyleng)
static DString g_localStoreRepl
Definition configimpl.l:655
static Config::CompareMode g_compareMode
Definition configimpl.l:654
1201<Start>"@"{REGEX_a}{REGEX_w}*"@" {
1203 {
1204 g_localStoreRepl = yytext;
1205 BEGIN(StoreRepl);
1206 }
1207 else
1208 {
1209 ConfigImpl::config_warn("ignoring unknown '{}' at line {}, file {}\n",
1210 yytext,g_yyLineNr,g_yyFileName);
1211 }
1212 }
1213<Include>([^ \"\t\r\n]+)|("\""[^\n\"]+"\"") {
1215 BEGIN(Start);
1216 }
static void readIncludeFile(const DString &incName)
Definition configimpl.l:961
1217<<EOF>> {
1218 //printf("End of include file\n");
1219 //printf("Include stack depth=%d\n",g_includeStack.count());
1220 if (g_includeStack.empty())
1221 {
1222 //printf("Terminating scanner!\n");
1223 yyterminate();
1224 }
1225 else
1226 {
1227 auto &fs=g_includeStack.back();
1228 fclose(fs->filePtr);
1229 YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
1230 yy_switch_to_buffer( fs->oldState );
1231 yy_delete_buffer( oldBuf );
1232 g_yyLineNr=fs->lineNr;
1233 g_yyFileName=fs->fileName;
1234 g_includeStack.pop_back();
1235 }
1236 }
#define yyterminate()
int fclose(FILE *f)
Definition portable.cpp:369
1237
1238<Start>[a-z_A-Z0-9]+ { ConfigImpl::config_warn("ignoring unknown tag '{}' at line {}, file {}\n",yytext,g_yyLineNr,g_yyFileName); }
1239 /*-------------- GetString ---------------*/
1240
1241<StoreRepl>\n {
1242 g_localStoreRepl += yytext;
1246 g_yyLineNr++; // end of string
1247 BEGIN(Start);
1248 }
void appendStoreRepl(const DString &u)
Definition configimpl.h:574
static void processStoreRepl(DString &storeReplStr)
Definition configimpl.l:760
1249<StoreRepl>\\‍[ \r\t]*\n { g_yyLineNr++; // line continuation
1250 g_localStoreRepl += yytext;
1251 }
1252<StoreRepl>"\\" { // escape character
1253 g_localStoreRepl += yytext;
1254 }
1255<StoreRepl>[^\n\\‍]+ { // string part without escape characters
1256 g_localStoreRepl += yytext;
1257 }
1258 /*-------------- GetString ---------------*/
1259
1260<GetString>\n { processString();
1261 g_yyLineNr++; // end of string
1262 BEGIN(Start);
1263 }
1264<GetString>\\‍[ \r\t]*\n { g_yyLineNr++; // line continuation
1265 *g_string+=' ';
1266 }
1267<GetString>"\\" { // escape character
1268 *g_string+=yytext;
1269 }
1270<GetString>[^\n\\‍]+ { // string part without escape characters
1271 *g_string+=yytext;
1272 }
1273
1274 /*-------------- GetStrList --------------*/
1275
1276<GetStrList>\n { processList();
1277 g_yyLineNr++; // end of list
1278 BEGIN(Start);
1279 }
1280<GetStrList>\\‍[ \r\t]*\n { g_yyLineNr++; // line continuation
1281 g_listStr+=' ';
1282 }
1283<GetStrList>"\\" { // escape character
1284 g_listStr+=yytext;
1285 }
1286<GetStrList>[^\n\\‍]+ { // string part without escape characters
1287 g_listStr+=yytext;
1288 }
1289
1290 /*-------------- SkipInvalid --------------*/
1291
1292<SkipInvalid>\n { g_yyLineNr++; // end of list
1293 BEGIN(Start);
1294 }
1295<SkipInvalid>\\‍[ \r\t]*\n { g_yyLineNr++; // line continuation
1296 }
1297<SkipInvalid>"\\" { // escape character
1298 }
1299<SkipInvalid>[^\n\\‍]+ { // string part without escape characters
1300 }
1301
1302 /*-------------- fall through -------------*/
1303
1304<*>\\‍[ \r\t]*\n { g_yyLineNr++; }
1305<*>[ \t\r]
1306<*>\n { g_yyLineNr++ ; }
1307<*>. {
1308 if (isprint(yytext[0]))
1309 ConfigImpl::config_warn("ignoring unknown character '{:c}' at line {}, file {}\n",yytext[0],g_yyLineNr,g_yyFileName);
1310 else
1311 ConfigImpl::config_warn("ignoring unknown character '0x{:x}' at line {}, file {}\n",yytext[0],g_yyLineNr,g_yyFileName);
1312 }
1313
1314%%

◆ yyread()

int yyread ( char * buf,
int max_size )
static

Definition at line 668 of file configimpl.l.

669{
670 // no file included
671 if (g_includeStack.empty())
672 {
673 int c=0;
674 if (g_inputString==0) return c;
675 while( c < max_size && g_inputString[g_inputPosition] )
676 {
678 c++; buf++;
679 }
680 return c;
681 }
682 else
683 {
684 //assert(g_includeStack.current()->newState==YY_CURRENT_BUFFER);
685 return static_cast<int>(fread(buf,1,max_size,g_includeStack.back()->filePtr));
686 }
static const char * g_inputString
Definition configimpl.l:641
static int g_inputPosition
Definition configimpl.l:642
687}

References g_includeStack, g_inputPosition, g_inputString, and yyread().

Variable Documentation

◆ error_str

const char* error_str = "error: "
static

Definition at line 57 of file configimpl.l.

Referenced by ConfigImpl::config_err_(), and ConfigImpl::config_term_().

◆ g_cmd

DString g_cmd
static

Definition at line 645 of file configimpl.l.

Referenced by processList(), and processString().

◆ g_compareMode

Definition at line 654 of file configimpl.l.

Referenced by Config::parse().

◆ g_config

ConfigImpl* g_config = nullptr
static

Definition at line 653 of file configimpl.l.

Referenced by checkEncoding(), Config::parse(), ConfigImpl::parseString(), and stripComment().

◆ g_configUpdate

bool g_configUpdate = false
static

Definition at line 651 of file configimpl.l.

Referenced by ConfigImpl::parseString().

◆ g_encoding

DString g_encoding
static

◆ g_includePathList

StringVector g_includePathList
static

Definition at line 649 of file configimpl.l.

Referenced by findFile().

◆ g_includeStack

std::vector< std::unique_ptr<ConfigFileState> > g_includeStack
static

Definition at line 650 of file configimpl.l.

Referenced by ConfigImpl::parseString(), readIncludeFile(), and yyread().

◆ g_inputPosition

int g_inputPosition = 0
static

Definition at line 642 of file configimpl.l.

Referenced by ConfigImpl::parseString(), and yyread().

◆ g_inputString

const char* g_inputString = nullptr
static

Definition at line 641 of file configimpl.l.

Referenced by ConfigImpl::parseString(), and yyread().

◆ g_list

StringVector* g_list = nullptr
static

Definition at line 647 of file configimpl.l.

Referenced by processList().

◆ g_listStr

DString g_listStr
static

Definition at line 648 of file configimpl.l.

Referenced by processList().

◆ g_localStoreRepl

DString g_localStoreRepl
static

Definition at line 655 of file configimpl.l.

◆ g_string

DString* g_string = nullptr
static

Definition at line 646 of file configimpl.l.

Referenced by processString().

◆ g_yyFileName

DString g_yyFileName
static

Definition at line 644 of file configimpl.l.

Referenced by ConfigImpl::parseString(), processList(), processString(), and readIncludeFile().

◆ g_yyLineNr

int g_yyLineNr = 1
static

Definition at line 643 of file configimpl.l.

Referenced by ConfigImpl::parseString(), processList(), processString(), and readIncludeFile().

◆ reEnvVar

const reg::Ex reEnvVar(R"(\$\‍((\a[\w.-]*)\‍))") ( R"(\$\‍((\a[\w.-]*)\‍))" )
static

◆ reEnvVar1CMake

const reg::Ex reEnvVar1CMake(R"(\${\a\w*})") ( R"(\${\a\w*})" )
static

Referenced by containsEnvVar().

◆ reEnvVarCMake

const reg::Ex reEnvVarCMake(R"(@\a\w*@)") ( R"(@\a\w*@)" )
static

Referenced by containsEnvVar().

◆ reEnvVarExt

const reg::Ex reEnvVarExt(R"(\$\‍((\a[\w.-]*\‍(\a[\w.-]*\‍))\‍))") ( R"(\$\‍((\a[\w.-]*\‍(\a[\w.-]*\‍))\‍))" )
static

◆ warning_str

const char* warning_str = "warning: "
static

Definition at line 56 of file configimpl.l.

Referenced by ConfigImpl::config_warn_().