mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Rename Zeexygen to Zeekygen
This commit is contained in:
parent
f2f06d66c0
commit
84ca12fdb4
78 changed files with 444 additions and 440 deletions
67
src/zeekygen/utils.h
Normal file
67
src/zeekygen/utils.h
Normal file
|
@ -0,0 +1,67 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#ifndef ZEEKYGEN_UTILS_H
|
||||
#define ZEEKYGEN_UTILS_H
|
||||
|
||||
#include "ID.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace zeekygen {
|
||||
|
||||
/**
|
||||
* Transform content of a Zeekygen comment which may contain function
|
||||
* parameter or return value documentation to a prettier reST format.
|
||||
* @param s Content from a Zeekygen comment to transform. "id: ..." and
|
||||
* "Returns: ..." change to ":id: ..." and ":returns: ...".
|
||||
* @return Whether any content in \a s was transformed.
|
||||
*/
|
||||
bool prettify_params(std::string& s);
|
||||
|
||||
/**
|
||||
* Check whether an identifier is part of the "public" interface.
|
||||
* @param id A script-level identifier.
|
||||
* @return true if the ID is in the global scope or if it's exported in to
|
||||
* any modules namespace.
|
||||
*/
|
||||
bool is_public_api(const ID* id);
|
||||
|
||||
/**
|
||||
* Get the modification time of a file or abort if there's an error.
|
||||
* @param filename Path to a file.
|
||||
* @return The modification time of \a filename via stat(2).
|
||||
*/
|
||||
time_t get_mtime(const std::string& filename);
|
||||
|
||||
/**
|
||||
* Make a reST-style heading.
|
||||
* @param heading Content of the heading.
|
||||
* @param underline Character in which to underline heading content.
|
||||
* @return underlined heading string.
|
||||
*/
|
||||
std::string make_heading(const std::string& heading, char underline);
|
||||
|
||||
/**
|
||||
* Get the position of the end of the first sentence in a string.
|
||||
* @param s Any string.
|
||||
* @return The position which looks like the end of the first sentence in
|
||||
* \a s or 0 if no such position is found.
|
||||
*/
|
||||
size_t end_of_first_sentence(const std::string& s);
|
||||
|
||||
/**
|
||||
* Check if a string is entirely white space.
|
||||
* @param s Any string.
|
||||
* @return True if \a s is nothing but white space, else false.
|
||||
*/
|
||||
bool is_all_whitespace(const std::string& s);
|
||||
|
||||
/**
|
||||
* @return a string indicating the script that has redef'd an enum value or
|
||||
* record field.
|
||||
*/
|
||||
std::string redef_indication(const std::string& from_script);
|
||||
|
||||
} // namespace zeekygen
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue