未为所有类生成文档

发布于 2024-12-27 14:01:02 字数 6814 浏览 1 评论 0原文

我有两个类 LinkMetaData (代码如下)。这些类位于同一文件夹中。但是,在 Doxygen 生成的文档中,类 Link 已记录,但类 MetaData 未记录。有什么想法吗?

链接:

#include <string.h>
#include <dbus-c++/dbus.h>

#ifndef LINK_H_
#define LINK_H_

typedef ::DBus::Struct< std::string, std::string > Link_Dbus_t;

class Link {

private:

const char* mUrl;
const char* mExpirationDate;

public:
Link();
virtual ~Link();
Link(const Link& l);

void setUrl(const char* url);
void setExpirationDate(const char* date);

const char* getUrl();
const char* getExpirationDate();

void operator << (const Link_Dbus_t& link_info);
};

Link_Dbus_t& operator << (Link_Dbus_t& link_info, Link& link);

#endif /* LINK_H_ */

元数据:

#include <vector>
#include <iostream>
#include <string.h>
#include <dbus-c++/dbus.h>
#include "MetadataAttributes.h"

using namespace std;

#ifndef METADATA_H_
#define METADATA_H_

typedef vector< metadataStruct_Dbus_t >  metadataVector_Dbus_t;


class MetaData : public vector <MetadataAttributes> {

private:

const char* mSize;
const char* mRev;
const char* mModified;
const char* mPath;
const char* mIcon;
const char* mRoot;
const char* mMimeType;
const char* mHash;

int mRevision;
int mBytes;

bool mThumbExists;
bool mIsDir;
bool mIsDeleted;

vector<MetaData> mLinkedMetaData;


public:

enum ePrintWhat {

    PRINT_METADATA_OF_FILES_AND_FOLDERS,
    PRINT_REVISION_FILES,
    PRINT_SEARCHED_FILES,
    PRINT_RESTORED_FILE,
    PRINT_COPIED_FILE,
    PRINT_CREATED_FOLDER,
    PRINT_DELETED_FILE_OR_FOLDER,
    PRINT_MOVED_FILE
};

MetaData();
virtual ~MetaData();
MetaData(const MetaData& m);

void setSize(const char* size);
void setRev(const char* rev);
void setModified(const char* modified);
void setPath(const char* path);
void setIcon(const char* icon);
void setRoot(const char* root);
void setMimeType(const char* mimeType);
void setHash(const char* hash);
void setRevision(int revision);
void setBytes(int bytes);
void thumbExists(bool thumbExists);
void isDir(bool isDir);
void isDeleted(bool isDeleted);

const char* getSize();
const char* getRev();
const char* getModified();
const char* getPath();
const char* getIcon();
const char* getRoot();
const char* getMimeType();
const char* getHash();
int getRevision();
int getBytes();
bool thumbExists();
bool isDir();
bool isDeleted();


vector<MetaData>* getLinkedMetaData();

void printMetadata(ePrintWhat printWhat);

void operator << (const metadataVector_Dbus_t data_vec);

};

metadataVector_Dbus_t &operator << (metadataVector_Dbus_t& s1, const MetaData &s2);

#endif /* METADATA_H_ */

编辑: 我发现当我隔离 MetaData 和 Session 这两个类时,MetaData 类不会被记录。无论如何都存在文件冲突。 这是会话类:

#include <iostream>
#include "Account.h"
#include "MetaData.h"
#include "Link.h"
#include "WatchThread.h"
#include <map>
#include <json/json.h>
#include <oauth.h>
#include <string.h>
#include <curl/curl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <pthread.h>
#include <sys/time.h>


using namespace std;

#ifndef SESSION_H_
#define SESSION_H_

class Session {

private:

typedef void (*TransferFinishedCallback)(unsigned int,const char*);
typedef void (*WatchCallback)(unsigned int, const char*, bool,bool);
typedef void (*WatchThreadInitedCallback)(unsigned int);

unsigned int mThread_id;

map<unsigned int,WatchThread> mWatchThreads;
map<unsigned int,pthread_t> mDownloadThreads;
map<unsigned int,pthread_t> mUploadThreads;

const char* mConsumer_key;
const char* mConsumer_secret;

const char* mRequestToken;
const char* mRequestTokenSecret;

const char* mAccessToken;
const char* mAcccessTokenSecret;


bool jsonParseErrorIsOccured(const char* c);
void jsonParseLink(json_object* jobj,Link *link);
void jsonParseAccountInfo(json_object* jobj, Account *account);
void jsonParseMetadata(json_object* jobj,MetaData *metadata);
void jsonParseArray(json_object* jobj, char* key, MetaData *metadata);
void parseTokenAndSecretValueFromString(const char* s, const char* &token, const     char* &secret);
char* getMetaDataUrl(const char* fileOrFolderPath, const char* hash, bool list, bool include_deleted, const char* rev);

public:

Session();
Session(const char* mConsumer_key,const char* mConsumer_secret);
virtual ~Session();
Session(const Session& s);

struct arg_struct;
struct watch_struct;

const char* login();

bool login(const char* accessToken, const char* accessTokenSecret);

void acquireAccessToken(const char* &accessToken, const char* &accessTokenSecret);

bool userIsAuthorized();

Account* getAccountInfo();

MetaData* getMetaDataOfFileOrFolder(const char* fileOrFolderPath,const char* hash, bool list, bool include_deleted,
        const char* rev);

MetaData* getMetDataOfFileRevisions(const char* filePath,const char* revLimit);

unsigned int getFile(const char* filePath,const char* targetFilePath, const char* rev, TransferFinishedCallback callback);

void stopDownloading(unsigned int id);

unsigned int putFile(const char* filePath, const char* targetFilePath,bool overwrite, const char* parent_rev, TransferFinishedCallback callback);

void stopUploading(unsigned int id);

MetaData* restoreFileToRevision(const char* filePath, const char* rev);

MetaData* searchForFileInFolder(const char* folderPath,const char* query,const char* fileLimit, bool include_deleted);

Link* createShareableLink(const char* fileOrFolderPath);

Link* getLinkToFile(const char* filepath);

unsigned int getThumbnail(const char* imageFilePath, const char* format, const char* size, const char* targetFilePath, TransferFinishedCallback callback);

MetaData* copyFolderOrFileTo(const char* root,const char* from_path, const char* to_path);

MetaData* createFolder(const char* root, const char* targetPath);

MetaData* deleteFileOrFolder(const char* root, const char* fileOrFolderPath);

MetaData* moveFileOrFolderTo(const char* root, const char* from_path, const char* to_path);

unsigned int watchFileOrFolder(const char* fileOrFolderPath, unsigned int updateInterval,WatchCallback callback_finish,WatchThreadInitedCallback callback_init, bool recursive);

const char* getRequestToken();

const char* getRequestTokenSecret();

const char* getAccessToken();

const char* getAccessTokenSecret();

void deleteWatchThreadWithId(unsigned int id);

void stopWatchThread(unsigned int id);

vector<int> runningWatchThreads();

vector<int> runningDownloadThreads();

vector<int> runningUploadThreads();

void setAccessToken(const char* accessToken, const char* accessTokenSecret);

};

#endif /* SESSION_H_ */

I have two classes Link and MetaData (code below). The classes are in the same folder. However, in documentation generated by Doxygen the class Link is documented but the class MetaData is not. Any ideas why this is?

Link:

#include <string.h>
#include <dbus-c++/dbus.h>

#ifndef LINK_H_
#define LINK_H_

typedef ::DBus::Struct< std::string, std::string > Link_Dbus_t;

class Link {

private:

const char* mUrl;
const char* mExpirationDate;

public:
Link();
virtual ~Link();
Link(const Link& l);

void setUrl(const char* url);
void setExpirationDate(const char* date);

const char* getUrl();
const char* getExpirationDate();

void operator << (const Link_Dbus_t& link_info);
};

Link_Dbus_t& operator << (Link_Dbus_t& link_info, Link& link);

#endif /* LINK_H_ */

MetaData:

#include <vector>
#include <iostream>
#include <string.h>
#include <dbus-c++/dbus.h>
#include "MetadataAttributes.h"

using namespace std;

#ifndef METADATA_H_
#define METADATA_H_

typedef vector< metadataStruct_Dbus_t >  metadataVector_Dbus_t;


class MetaData : public vector <MetadataAttributes> {

private:

const char* mSize;
const char* mRev;
const char* mModified;
const char* mPath;
const char* mIcon;
const char* mRoot;
const char* mMimeType;
const char* mHash;

int mRevision;
int mBytes;

bool mThumbExists;
bool mIsDir;
bool mIsDeleted;

vector<MetaData> mLinkedMetaData;


public:

enum ePrintWhat {

    PRINT_METADATA_OF_FILES_AND_FOLDERS,
    PRINT_REVISION_FILES,
    PRINT_SEARCHED_FILES,
    PRINT_RESTORED_FILE,
    PRINT_COPIED_FILE,
    PRINT_CREATED_FOLDER,
    PRINT_DELETED_FILE_OR_FOLDER,
    PRINT_MOVED_FILE
};

MetaData();
virtual ~MetaData();
MetaData(const MetaData& m);

void setSize(const char* size);
void setRev(const char* rev);
void setModified(const char* modified);
void setPath(const char* path);
void setIcon(const char* icon);
void setRoot(const char* root);
void setMimeType(const char* mimeType);
void setHash(const char* hash);
void setRevision(int revision);
void setBytes(int bytes);
void thumbExists(bool thumbExists);
void isDir(bool isDir);
void isDeleted(bool isDeleted);

const char* getSize();
const char* getRev();
const char* getModified();
const char* getPath();
const char* getIcon();
const char* getRoot();
const char* getMimeType();
const char* getHash();
int getRevision();
int getBytes();
bool thumbExists();
bool isDir();
bool isDeleted();


vector<MetaData>* getLinkedMetaData();

void printMetadata(ePrintWhat printWhat);

void operator << (const metadataVector_Dbus_t data_vec);

};

metadataVector_Dbus_t &operator << (metadataVector_Dbus_t& s1, const MetaData &s2);

#endif /* METADATA_H_ */

EDIT:
I detected that when I isolate the two classes MetaData and Session then the MetaData class is not documented. There is in any way a file conflict.
Here's the Session class:

#include <iostream>
#include "Account.h"
#include "MetaData.h"
#include "Link.h"
#include "WatchThread.h"
#include <map>
#include <json/json.h>
#include <oauth.h>
#include <string.h>
#include <curl/curl.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#include <pthread.h>
#include <sys/time.h>


using namespace std;

#ifndef SESSION_H_
#define SESSION_H_

class Session {

private:

typedef void (*TransferFinishedCallback)(unsigned int,const char*);
typedef void (*WatchCallback)(unsigned int, const char*, bool,bool);
typedef void (*WatchThreadInitedCallback)(unsigned int);

unsigned int mThread_id;

map<unsigned int,WatchThread> mWatchThreads;
map<unsigned int,pthread_t> mDownloadThreads;
map<unsigned int,pthread_t> mUploadThreads;

const char* mConsumer_key;
const char* mConsumer_secret;

const char* mRequestToken;
const char* mRequestTokenSecret;

const char* mAccessToken;
const char* mAcccessTokenSecret;


bool jsonParseErrorIsOccured(const char* c);
void jsonParseLink(json_object* jobj,Link *link);
void jsonParseAccountInfo(json_object* jobj, Account *account);
void jsonParseMetadata(json_object* jobj,MetaData *metadata);
void jsonParseArray(json_object* jobj, char* key, MetaData *metadata);
void parseTokenAndSecretValueFromString(const char* s, const char* &token, const     char* &secret);
char* getMetaDataUrl(const char* fileOrFolderPath, const char* hash, bool list, bool include_deleted, const char* rev);

public:

Session();
Session(const char* mConsumer_key,const char* mConsumer_secret);
virtual ~Session();
Session(const Session& s);

struct arg_struct;
struct watch_struct;

const char* login();

bool login(const char* accessToken, const char* accessTokenSecret);

void acquireAccessToken(const char* &accessToken, const char* &accessTokenSecret);

bool userIsAuthorized();

Account* getAccountInfo();

MetaData* getMetaDataOfFileOrFolder(const char* fileOrFolderPath,const char* hash, bool list, bool include_deleted,
        const char* rev);

MetaData* getMetDataOfFileRevisions(const char* filePath,const char* revLimit);

unsigned int getFile(const char* filePath,const char* targetFilePath, const char* rev, TransferFinishedCallback callback);

void stopDownloading(unsigned int id);

unsigned int putFile(const char* filePath, const char* targetFilePath,bool overwrite, const char* parent_rev, TransferFinishedCallback callback);

void stopUploading(unsigned int id);

MetaData* restoreFileToRevision(const char* filePath, const char* rev);

MetaData* searchForFileInFolder(const char* folderPath,const char* query,const char* fileLimit, bool include_deleted);

Link* createShareableLink(const char* fileOrFolderPath);

Link* getLinkToFile(const char* filepath);

unsigned int getThumbnail(const char* imageFilePath, const char* format, const char* size, const char* targetFilePath, TransferFinishedCallback callback);

MetaData* copyFolderOrFileTo(const char* root,const char* from_path, const char* to_path);

MetaData* createFolder(const char* root, const char* targetPath);

MetaData* deleteFileOrFolder(const char* root, const char* fileOrFolderPath);

MetaData* moveFileOrFolderTo(const char* root, const char* from_path, const char* to_path);

unsigned int watchFileOrFolder(const char* fileOrFolderPath, unsigned int updateInterval,WatchCallback callback_finish,WatchThreadInitedCallback callback_init, bool recursive);

const char* getRequestToken();

const char* getRequestTokenSecret();

const char* getAccessToken();

const char* getAccessTokenSecret();

void deleteWatchThreadWithId(unsigned int id);

void stopWatchThread(unsigned int id);

vector<int> runningWatchThreads();

vector<int> runningDownloadThreads();

vector<int> runningUploadThreads();

void setAccessToken(const char* accessToken, const char* accessTokenSecret);

};

#endif /* SESSION_H_ */

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆悲凉 2025-01-03 14:01:02

有两个可能的原因,要么是 Doxygen 配置文件中的错误,要么是目录中另一个文件的冲突。

要查看 Doxygen 配置文件,请生成默认的 Doxyfile (doxygen -s -g),并查看默认配置与您正在使用的版本之间的差异。对于任何差异,您可能需要尝试将 Doxyfile 中的值设置为默认值,以确定是否会产生差异。请特别注意 EXTRACT_*HIDE_*SHOW_* 选项。

要确定是否可能是文件冲突,请暂时从目录中删除所有其他文件,并确定文档是否是单独生成的。如果是,请重新添加文件,直到不再生成该类,然后检查添加的文件以确定是否有任何内容可能导致与 MetaData 发生冲突。如果即使单独也没有记录,请再次检查您的 Doxygen 配置文件。

作为实验,我将描述的两个文件与 Doxygen 1.7.6.1 中默认生成的 Doxyfile 一起放置在临时目录中。这两个类都有记录,但它们的成员没有联系。更改 Doxyfile 以指定 EXTRACT_ALL=YES 会导致所有成员都被记录下来。

There are two likely causes, either an error in your Doxygen configuration file, or a conflict in another file in the directory.

To review the Doxygen configuration file, generate a default Doxyfile (doxygen -s -g), and review the differences between the default configuration and the version you are using. For any differences you may want to try setting the value to the default from the Doxyfile to determine if that makes a difference. Pay particular attention to the EXTRACT_*, HIDE_* and SHOW_* options.

To determine if it may be a file conflict, temporarily remove all other files from the directory and determine if Documentation is generated in isolation. If it is, re-add files until the class is no longer generated, and then review the added files to determine what if anything might be causing a conflict with MetaData. If it is not documented even in isolation, review your Doxygen configuration file again.

As an experiment I placed the two files described in a temporary directory along with a default generated Doxyfile from Doxygen 1.7.6.1. Both classes were documented, however their members were not linked. Changing the Doxyfile to specify EXTRACT_ALL=YES caused the members to all be documented.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文